diff options
author | Adam Nemet <anemet@apple.com> | 2015-02-18 03:43:19 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2015-02-18 03:43:19 +0000 |
commit | 01abb2c35536d13f660d90ebffc8d2e536f0cb87 (patch) | |
tree | f514a86bad2961c0751022889b7779603e418f4c /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | 3cf32ad6dbb2bb7f72a195c5d60df753e7496380 (diff) | |
download | bcm5719-llvm-01abb2c35536d13f660d90ebffc8d2e536f0cb87.tar.gz bcm5719-llvm-01abb2c35536d13f660d90ebffc8d2e536f0cb87.zip |
[LoopAccesses] Make blockNeedsPredication static
blockNeedsPredication is in LoopAccess in order to share it with the
vectorizer. It's a utility needed by LoopAccess not strictly provided
by it but it's a good place to share it. This makes the function static
so that it no longer required to create an LoopAccessInfo instance in
order to access it from LV.
This was actually causing problems because it would have required
creating LAI much earlier that LV::canVectorizeMemory().
This is part of the patchset that converts LoopAccessAnalysis into an
actual analysis pass.
llvm-svn: 229625
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 1def103d970..1dc4041a300 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -554,7 +554,7 @@ public: AliasAnalysis *AA, Function *F, const TargetTransformInfo *TTI) : NumPredStores(0), TheLoop(L), SE(SE), DL(DL), - TLI(TLI), TheFunction(F), TTI(TTI), Induction(nullptr), + TLI(TLI), TheFunction(F), TTI(TTI), DT(DT), Induction(nullptr), WidestIndTy(nullptr), LAI(L, SE, DL, TLI, AA, DT), HasFunNoNaNAttr(false) {} @@ -855,6 +855,8 @@ private: Function *TheFunction; /// Target Transform Info const TargetTransformInfo *TTI; + /// Dominator Tree. + DominatorTree *DT; // --- vectorization state --- // @@ -4173,7 +4175,7 @@ bool LoopVectorizationLegality::isInductionVariable(const Value *V) { } bool LoopVectorizationLegality::blockNeedsPredication(BasicBlock *BB) { - return LAI.blockNeedsPredication(BB); + return LoopAccessInfo::blockNeedsPredication(BB, TheLoop, DT); } bool LoopVectorizationLegality::blockCanBePredicated(BasicBlock *BB, |