diff options
author | Silviu Baranga <silviu.baranga@arm.com> | 2015-12-09 15:25:28 +0000 |
---|---|---|
committer | Silviu Baranga <silviu.baranga@arm.com> | 2015-12-09 15:25:28 +0000 |
commit | ad1ccb357b81d58e4fa15a4239ad5da7230a8d0d (patch) | |
tree | dbc9d96ca19238ced92ff053c15ffde9b80b829a /llvm/lib/Transforms/Utils | |
parent | 4514a87c4d6b13c61902cec4211d8dde72af8b44 (diff) | |
download | bcm5719-llvm-ad1ccb357b81d58e4fa15a4239ad5da7230a8d0d.tar.gz bcm5719-llvm-ad1ccb357b81d58e4fa15a4239ad5da7230a8d0d.zip |
Revert r255115 until we figure out how to fix the bot failures.
llvm-svn: 255117
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 43 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopVersioning.cpp | 4 |
2 files changed, 2 insertions, 45 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 091f14ebe9f..e03880526bf 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -727,46 +727,3 @@ SmallVector<Instruction *, 8> llvm::findDefsUsedOutsideOfLoop(Loop *L) { return UsedOutside; } - -PredicatedScalarEvolution::PredicatedScalarEvolution(ScalarEvolution &SE) - : SE(SE), Generation(0) {} - -const SCEV *PredicatedScalarEvolution::getSCEV(Value *V) { - const SCEV *Expr = SE.getSCEV(V); - RewriteEntry &Entry = RewriteMap[Expr]; - - // If we already have an entry and the version matches, return it. - if (Entry.second && Generation == Entry.first) - return Entry.second; - - // We found an entry but it's stale. Rewrite the stale entry - // acording to the current predicate. - if (Entry.second) - Expr = Entry.second; - - const SCEV *NewSCEV = SE.rewriteUsingPredicate(Expr, Preds); - Entry = {Generation, NewSCEV}; - - return NewSCEV; -} - -void PredicatedScalarEvolution::addPredicate(const SCEVPredicate &Pred) { - if (Preds.implies(&Pred)) - return; - Preds.add(&Pred); - updateGeneration(); -} - -const SCEVUnionPredicate &PredicatedScalarEvolution::getUnionPredicate() const { - return Preds; -} - -void PredicatedScalarEvolution::updateGeneration() { - // If the generation number wrapped recompute everything. - if (++Generation == 0) { - for (auto &II : RewriteMap) { - const SCEV *Rewritten = II.second.second; - II.second = {Generation, SE.rewriteUsingPredicate(Rewritten, Preds)}; - } - } -} diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp index 9a2a06cf689..cc3ff5d80d4 100644 --- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp +++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp @@ -32,7 +32,7 @@ LoopVersioning::LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI, assert(L->getLoopPreheader() && "No preheader"); if (UseLAIChecks) { setAliasChecks(LAI.getRuntimePointerChecking()->getChecks()); - setSCEVChecks(LAI.PSE.getUnionPredicate()); + setSCEVChecks(LAI.Preds); } } @@ -58,7 +58,7 @@ void LoopVersioning::versionLoop( LAI.addRuntimeChecks(RuntimeCheckBB->getTerminator(), AliasChecks); assert(MemRuntimeCheck && "called even though needsAnyChecking = false"); - const SCEVUnionPredicate &Pred = LAI.PSE.getUnionPredicate(); + const SCEVUnionPredicate &Pred = LAI.Preds; SCEVExpander Exp(*SE, RuntimeCheckBB->getModule()->getDataLayout(), "scev.check"); SCEVRuntimeCheck = |