summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-20 08:35:24 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-20 08:35:24 +0000
commit5175b9a7b9bcbe895b3ec484f5984551e19bf903 (patch)
tree12d2ac58d8e54e1e14b3d78913d361d78f811adf /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
parent42971a3342711aacb3d81491bea5ef5e9277f803 (diff)
downloadbcm5719-llvm-5175b9a7b9bcbe895b3ec484f5984551e19bf903.tar.gz
bcm5719-llvm-5175b9a7b9bcbe895b3ec484f5984551e19bf903.zip
[PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses. The most obvious reason why is because eventually I need to separate out the pass layer from the rest of the instcombiner. However, it is also probably a compile time win as every query through the pass manager layer is pretty slow these days. llvm-svn: 226550
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index fb1332a5493..5e9a22ca12e 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -799,9 +799,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) {
// If the incoming non-constant value is in I's block, we will remove one
// instruction, but insert another equivalent one, leading to infinite
// instcombine.
- auto *LIWP = getAnalysisIfAvailable<LoopInfoWrapperPass>();
- if (isPotentiallyReachable(I.getParent(), NonConstBB, DT,
- LIWP ? &LIWP->getLoopInfo() : nullptr))
+ if (isPotentiallyReachable(I.getParent(), NonConstBB, DT, LI))
return nullptr;
}
@@ -2975,6 +2973,8 @@ bool InstCombiner::runOnFunction(Function &F) {
DataLayoutPass *DLP = getAnalysisIfAvailable<DataLayoutPass>();
DL = DLP ? &DLP->getDataLayout() : nullptr;
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+ auto *LIWP = getAnalysisIfAvailable<LoopInfoWrapperPass>();
+ LI = LIWP ? &LIWP->getLoopInfo() : nullptr;
TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
// Minimizing size?
OpenPOWER on IntegriCloud