llvm-6502/test/Transforms
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
..
ADCE
AddDiscriminators
ArgumentPromotion DebugInfo: Keep track of subprograms who's arguments have been promoted. 2014-07-01 21:13:37 +00:00
AtomicExpandLoadLinked/ARM CodeGen: it turns out that NAND is not the same thing as BIC. At all. 2014-07-07 09:06:35 +00:00
BBVectorize Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
BranchFolding
CodeExtractor
CodeGenPrepare Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
ConstantHoisting [ConstantHoisting][X86] Improve the cost model for small constants with large types (i64 and above). 2014-06-10 00:32:29 +00:00
ConstantMerge
ConstProp Look through addrspacecast in IsConstantOffsetFromGlobal 2014-07-14 22:39:26 +00:00
CorrelatedValuePropagation
DeadArgElim
DeadStoreElimination Improve BasicAA CS-CS queries (redux) 2014-07-17 01:28:25 +00:00
DebugIR
EarlyCSE
FunctionAttrs
GCOVProfiling Fix coverage for files with global constructors again. Adds a testcase to the commit from r206671, as requested by David Blaikie. 2014-06-05 04:31:43 +00:00
GlobalDCE Revert "GlobalDCE: Delete available_externally initializers if it allows removing the value the initializer is referring to." 2014-07-08 17:06:03 +00:00
GlobalOpt GlobalOpt: Don't swap private for internal linkage 2014-07-01 15:26:50 +00:00
GVN Look through addrspacecast in GetPointerBaseWithConstantOffset 2014-07-14 22:39:22 +00:00
IndVarSimplify Add a description to the test from r211433 explaining why it's written that way. 2014-06-22 12:22:04 +00:00
Inline Add new lines to debugging information. 2014-07-03 02:11:49 +00:00
InstCombine Move ashr optimization from InstCombineShift to InstSimplify. 2014-07-17 06:28:15 +00:00
InstMerge MergedLoadStoreMotion pass 2014-07-18 19:13:09 +00:00
InstSimplify Add a dereferenceable attribute 2014-07-18 15:51:28 +00:00
Internalize
IPConstantProp
JumpThreading Fixed jump threading going to infinite loop. 2014-06-17 14:34:19 +00:00
LCSSA
LICM Make Value::isDereferenceablePointer handle offsets to pointer types with dereferenceable attributes 2014-07-19 03:25:16 +00:00
LoadCombine
LoopDeletion
LoopIdiom R600: Implement TTI:getPopcntSupport 2014-07-18 06:07:13 +00:00
LoopReroll
LoopRotate
LoopSimplify
LoopStrengthReduce Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00
LoopUnroll Remove unroll pragma metadata after it is used. 2014-07-18 21:04:33 +00:00
LoopUnswitch
LoopVectorize [LoopVectorize] Use AA to partition potential dependency checks 2014-07-20 23:07:52 +00:00
LowerAtomic IR: add "cmpxchg weak" variant to support permitted failure. 2014-06-13 14:24:07 +00:00
LowerExpectIntrinsic
LowerInvoke
LowerSwitch Added test for commit r212802 that was missing 2014-07-11 10:36:00 +00:00
Mem2Reg
MemCpyOpt Don't eliminate memcpy's when the address of the pointer may itself be relevant. Fixes PR18304. Patch by David Wiberg! 2014-07-14 18:52:02 +00:00
MergeFunc MergeFunc patch from Björn Steinbrink. 2014-07-15 10:46:51 +00:00
MetaRenamer
ObjCARC
PhaseOrdering
PruneEH
Reassociate [Reassociate] FileCheckize and cleanup a few testcases. No functional change 2014-06-11 18:28:45 +00:00
Reg2Mem
SampleProfile
Scalarizer
ScalarRepl
SCCP SCCP: update for cmpxchg returning { iN, i1 } now. 2014-06-13 14:54:09 +00:00
SeparateConstOffsetFromGEP/NVPTX Partially revert r210444 due to performance regression 2014-07-16 23:25:00 +00:00
SimplifyCFG Fix for PR17073 ( http://llvm.org/pr17073 ), simplifycfg illegally hoists an operation in a phi node that can trap. 2014-07-07 21:19:00 +00:00
Sink
SLPVectorizer Add Support to Recognize and Vectorize NON SIMD instructions in SLPVectorizer. 2014-06-20 04:32:48 +00:00
SROA SROA: Only split loads on byte boundaries 2014-06-17 00:19:35 +00:00
StripSymbols
StructurizeCFG
TailCallElim
TailDup Reduce verbiage of lit.local.cfg files 2014-06-09 22:42:55 +00:00