llvm-6502/test/Transforms/LoopVectorize/X86
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
..
already-vectorized.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
avx1.ll
avx512.ll [X86] AVX512: Enable it in the Loop Vectorizer 2014-07-09 18:22:33 +00:00
constant-vector-operand.ll
conversion-cost.ll
cost-model.ll
fp32_to_uint32-cost-model.ll
fp64_to_uint32-cost-model.ll
fp_to_sint8-cost-model.ll
gather-cost.ll
gcc-examples.ll
illegal-parallel-loop-uniform-write.ll
lit.local.cfg
metadata-enable.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
min-trip-count-switch.ll
no-vector.ll
parallel-loops-after-reg2mem.ll
parallel-loops.ll
rauw-bug.ll
reduction-crash.ll
small-size.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
struct-store.ll
tripcount.ll
uint64_to_fp64-cost-model.ll
unroll_selection.ll
unroll-pm.ll
unroll-small-loops.ll
vect.omp.force.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
vect.omp.force.small-tc.ll Rename loop unrolling and loop vectorizer metadata to have a common prefix. 2014-06-25 15:41:00 +00:00
vector_ptr_load_store.ll [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
vector-scalar-select-cost.ll
vectorization-remarks-missed.ll Emit warnings if vectorization is forced and fails. 2014-07-16 00:36:00 +00:00
vectorization-remarks.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
x86_fp80-vector-store.ll