llvm-6502/test/Transforms/LoopVectorize
Hal Finkel 160f9b9c10 [LoopVectorize] Use AA to partition potential dependency checks
Prior to this change, the loop vectorizer did not make use of the alias
analysis infrastructure. Instead, it performed memory dependence analysis using
ScalarEvolution-based linear dependence checks within equivalence classes
derived from the results of ValueTracking's GetUnderlyingObjects.

Unfortunately, this meant that:
  1. The loop vectorizer had logic that essentially duplicated that in BasicAA
     for aliasing based on identified objects.
  2. The loop vectorizer could not partition the space of dependency checks
     based on information only easily available from within AA (TBAA metadata is
     currently the prime example).

This means, for example, regardless of whether -fno-strict-aliasing was
provided, the vectorizer would only vectorize this loop with a runtime
memory-overlap check:

void foo(int *a, float *b) {
  for (int i = 0; i < 1600; ++i)
    a[i] = b[i];
}

This is suboptimal because the TBAA metadata already provides the information
necessary to show that this check unnecessary. Of course, the vectorizer has a
limit on the number of such checks it will insert, so in practice, ignoring
TBAA means not vectorizing more-complicated loops that we should.

This change causes the vectorizer to use an AliasSetTracker to keep track of
the pointers in the loop. The resulting alias sets are then used to partition
the space of dependency checks, and potential runtime checks; this results in
more-efficient vectorizations.

When pointer locations are added to the AliasSetTracker, two things are done:
  1. The location size is set to UnknownSize (otherwise you'd not catch
     inter-iteration dependencies)
  2. For instructions in blocks that would need to be predicated, TBAA is
     removed (because the metadata might have a control dependency on the condition
     being speculated).

For non-predicated blocks, you can leave the TBAA metadata. This is safe
because you can't have an iteration dependency on the TBAA metadata (if you
did, and you unrolled sufficiently, you'd end up with the same pointer value
used by two accesses that TBAA says should not alias, and that would yield
undefined behavior).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213486 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-20 23:07:52 +00:00
..
AArch64 Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
ARM Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
PowerPC Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
X86 [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
XCore Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
12-12-11-if-conv.ll
2012-10-20-infloop.ll
2012-10-22-isconsec.ll
align.ll
bsd_regex.ll
bzip_reverse_loops.ll
calloc.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
cast-induction.ll
control-flow.ll Add Rpass-missed and Rpass-analysis reports to the loop vectorizer. The remarks give the vector width of vectorized loops and a brief analysis of loops that fail to be vectorized. For example, an analysis will be generated for loops containing control flow that cannot be simplified to a select. The optimization remarks also give the debug location of expressions that cannot be vectorized, for example the location of an unvectorizable call. 2014-06-25 17:50:15 +00:00
cpp-new-array.ll
dbg.value.ll
debugloc.ll
ee-crash.ll
flags.ll LoopVectorizer: Preserve fast-math flags 2014-03-05 21:10:47 +00:00
float-reduction.ll LoopVectorizer: Preserve fast-math flags 2014-03-05 21:10:47 +00:00
funcall.ll
gcc-examples.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
global_alias.ll InstCombine: Teach most integer add/sub/mul/div combines how to deal with vectors. 2014-01-19 15:24:22 +00:00
hoist-loads.ll
i8-induction.ll
if-conv-crash.ll
if-conversion-edgemasks.ll
if-conversion-nest.ll
if-conversion-reduction.ll
if-conversion.ll IR: Fold away compares between GV GEPs and GVs 2014-07-04 22:05:26 +00:00
if-pred-stores.ll LoopVectorizer: Keep track of conditional store basic blocks 2014-02-08 20:41:13 +00:00
increment.ll
induction_plus.ll
induction.ll LoopVectorizer: Fix a dominance issue 2014-06-22 03:38:59 +00:00
infiniteloop.ll
intrinsic.ll Allow vectorization of intrinsics such as powi,cttz and ctlz in Loop and SLP Vectorizer. 2014-05-30 04:31:24 +00:00
lcssa-crash.ll
lifetime.ll
memdep.ll
metadata-unroll.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
metadata-width.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
metadata.ll [LoopVectorize] Propagate known metadata to vectorized instructions 2014-07-19 13:33:16 +00:00
minmax_reduction.ll
multi-use-reduction-bug.ll LoopVectorizer: A reduction that has multiple uses of the reduction value is not 2014-01-19 03:18:31 +00:00
multiple-address-spaces.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
no_array_bounds.ll Emit warnings if vectorization is forced and fails. 2014-07-16 00:36:00 +00:00
no_idiv_reduction.ll
no_int_induction.ll
no_outside_user.ll
no_switch.ll Emit warnings if vectorization is forced and fails. 2014-07-16 00:36:00 +00:00
nofloat.ll
non-const-n.ll
nsw-crash.ll
opt.ll
phi-hang.ll
ptr_loops.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
read-only.ll
reduction.ll
reverse_induction.ll
reverse_iter.ll
runtime-check-address-space.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
runtime-check-readonly-address-space.ll
runtime-check-readonly.ll When we sink an instruction, this can open up opportunity for the operands to be sunk - add them to the worklist 2014-07-11 21:49:39 +00:00
runtime-check.ll
runtime-limit.ll
safegep.ll
same-base-access.ll
scalar-select.ll
scev-exitlim-crash.ll
simple-unroll.ll
small-loop.ll
start-non-zero.ll
store-shuffle-bug.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
struct_access.ll
tbaa-nodep.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
undef-inst-bug.ll
unroll_novec.ll [vectorizer] Add an override for the target instruction cost and use it 2014-01-27 11:41:50 +00:00
value-ptr-bug.ll Fix known typos 2014-01-24 17:20:08 +00:00
vect.omp.persistence.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
vect.stats.ll [CLNUP] Test commit. Remove newline. 2014-04-24 08:42:58 +00:00
vectorize-once.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
version-mem-access.ll LoopVectorize: Only strip casts from integer types when replacing symbolic 2014-01-15 03:35:46 +00:00
write-only.ll