From 18c2669acaad6f6f87fff86fca97d33e197e7564 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 13 Aug 2015 09:27:01 +0000 Subject: [LIR] Handle the LoopInfo the same as all the other analyses. No utility really in breaking pattern just for this analysis. llvm-svn: 244878 --- llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms') 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().getDomTree(); + LI = &getAnalysis().getLoopInfo(); SE = &getAnalysis(); TLI = &getAnalysis().getTLI(); TTI = &getAnalysis().getTTI( @@ -211,8 +213,6 @@ bool LoopIdiomRecognize::runOnCountableLoop() { if (BECst->getValue()->getValue() == 0) return false; - LoopInfo &LI = getAnalysis().getLoopInfo(); - SmallVector 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); -- cgit v1.2.3