summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-04-28 22:05:55 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-04-28 22:05:55 +0000
commit98a1de85cb07eeea466f65bd35e459340f03a819 (patch)
treec4672c20c52557d8656939901728b571d23385a8 /llvm/lib/Transforms
parent157ed94ee72b5e21e0a310491d6b807511d72f6b (diff)
downloadbcm5719-llvm-98a1de85cb07eeea466f65bd35e459340f03a819.tar.gz
bcm5719-llvm-98a1de85cb07eeea466f65bd35e459340f03a819.zip
LoopRotate: Fix use after scope bug
llvm-svn: 301702
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopRotation.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 40f60f2e758..2ba9265566a 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -670,8 +670,9 @@ PreservedAnalyses LoopRotatePass::run(Loop &L, LoopAnalysisManager &AM,
LPMUpdater &) {
int Threshold = EnableHeaderDuplication ? DefaultRotationThreshold : 0;
const DataLayout &DL = L.getHeader()->getModule()->getDataLayout();
+ const SimplifyQuery SQ = getBestSimplifyQuery(AR, DL);
LoopRotate LR(Threshold, &AR.LI, &AR.TTI, &AR.AC, &AR.DT, &AR.SE,
- getBestSimplifyQuery(AR, DL));
+ SQ);
bool Changed = LR.processLoop(&L);
if (!Changed)
@@ -714,8 +715,8 @@ public:
auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
auto *SEWP = getAnalysisIfAvailable<ScalarEvolutionWrapperPass>();
auto *SE = SEWP ? &SEWP->getSE() : nullptr;
- LoopRotate LR(MaxHeaderSize, LI, TTI, AC, DT, SE,
- getBestSimplifyQuery(*this, F));
+ const SimplifyQuery SQ = getBestSimplifyQuery(*this, F);
+ LoopRotate LR(MaxHeaderSize, LI, TTI, AC, DT, SE, SQ);
return LR.processLoop(L);
}
};
OpenPOWER on IntegriCloud