summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-08-13 09:27:01 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-08-13 09:27:01 +0000
commit18c2669acaad6f6f87fff86fca97d33e197e7564 (patch)
tree8e93e9aeada88bbb151383b42a544434a583fd2a /llvm/lib/Transforms
parent64ad85cef2efac2ba11b81c6de4cc46ae02981b2 (diff)
downloadbcm5719-llvm-18c2669acaad6f6f87fff86fca97d33e197e7564.tar.gz
bcm5719-llvm-18c2669acaad6f6f87fff86fca97d33e197e7564.zip
[LIR] Handle the LoopInfo the same as all the other analyses. No utility
really in breaking pattern just for this analysis. llvm-svn: 244878
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index e431609c474..e3fe2530c2b 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -70,6 +70,7 @@ namespace {
class LoopIdiomRecognize : public LoopPass {
Loop *CurLoop;
DominatorTree *DT;
+ LoopInfo *LI;
ScalarEvolution *SE;
TargetLibraryInfo *TLI;
const TargetTransformInfo *TTI;
@@ -188,6 +189,7 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L, LPPassManager &LPM) {
return false;
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+ LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
SE = &getAnalysis<ScalarEvolution>();
TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
@@ -211,8 +213,6 @@ bool LoopIdiomRecognize::runOnCountableLoop() {
if (BECst->getValue()->getValue() == 0)
return false;
- LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
-
SmallVector<BasicBlock *, 8> ExitBlocks;
CurLoop->getUniqueExitBlocks(ExitBlocks);
@@ -224,7 +224,7 @@ bool LoopIdiomRecognize::runOnCountableLoop() {
// Scan all the blocks in the loop that are not in subloops.
for (auto *BB : CurLoop->getBlocks()) {
// Ignore blocks in subloops.
- if (LI.getLoopFor(BB) != CurLoop)
+ if (LI->getLoopFor(BB) != CurLoop)
continue;
MadeChange |= runOnLoopBlock(BB, BECount, ExitBlocks);
OpenPOWER on IntegriCloud