diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-02-01 12:01:35 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-02-01 12:01:35 +0000 |
commit | fdb9c573f754364bddee53e75049e9ddd6cc457a (patch) | |
tree | 9fec4c626857f9b2189bb31068d52ad9b2c5b879 /llvm/lib/Transforms/Vectorize/BBVectorize.cpp | |
parent | bd57186c763f9c47a6da570f56aceabd830e32a0 (diff) | |
download | bcm5719-llvm-fdb9c573f754364bddee53e75049e9ddd6cc457a.tar.gz bcm5719-llvm-fdb9c573f754364bddee53e75049e9ddd6cc457a.zip |
[multiversion] Thread a function argument through all the callers of the
getTTI method used to get an actual TTI object.
No functionality changed. This just threads the argument and ensures
code like the inliner can correctly look up the callee's TTI rather than
using a fixed one.
The next change will use this to implement per-function subtarget usage
by TTI. The changes after that should eliminate the need for FTTI as that
will have become the default.
llvm-svn: 227730
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/BBVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index 8b541f6b1df..525c050cf28 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp @@ -201,7 +201,7 @@ namespace { initializeBBVectorizePass(*PassRegistry::getPassRegistry()); } - BBVectorize(Pass *P, const VectorizeConfig &C) + BBVectorize(Pass *P, Function &F, const VectorizeConfig &C) : BasicBlockPass(ID), Config(C) { AA = &P->getAnalysis<AliasAnalysis>(); DT = &P->getAnalysis<DominatorTreeWrapperPass>().getDomTree(); @@ -210,7 +210,7 @@ namespace { DL = DLP ? &DLP->getDataLayout() : nullptr; TTI = IgnoreTargetInfo ? nullptr - : &P->getAnalysis<TargetTransformInfoWrapperPass>().getTTI(); + : &P->getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F); } typedef std::pair<Value *, Value *> ValuePair; @@ -446,7 +446,8 @@ namespace { DL = DLP ? &DLP->getDataLayout() : nullptr; TTI = IgnoreTargetInfo ? nullptr - : &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(); + : &getAnalysis<TargetTransformInfoWrapperPass>().getTTI( + *BB.getParent()); return vectorizeBB(BB); } @@ -3207,7 +3208,7 @@ BasicBlockPass *llvm::createBBVectorizePass(const VectorizeConfig &C) { bool llvm::vectorizeBasicBlock(Pass *P, BasicBlock &BB, const VectorizeConfig &C) { - BBVectorize BBVectorizer(P, C); + BBVectorize BBVectorizer(P, *BB.getParent(), C); return BBVectorizer.vectorizeBB(BB); } |