diff options
| author | Dan Gohman <gohman@apple.com> | 2010-11-17 21:23:15 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-11-17 21:23:15 +0000 |
| commit | afd6db99322ca8a6556b1e93699b4b4c9ebf5080 (patch) | |
| tree | 0fa53a12b2a9c96bd60e4ff42ae36e22cf80b36d /llvm/lib/Analysis/ScalarEvolutionExpander.cpp | |
| parent | 5ba1459c4c65c56358a8fdd26c731398c4326e64 (diff) | |
| download | llvm-afd6db99322ca8a6556b1e93699b4b4c9ebf5080.zip llvm-afd6db99322ca8a6556b1e93699b4b4c9ebf5080.tar.gz llvm-afd6db99322ca8a6556b1e93699b4b4c9ebf5080.tar.bz2 | |
Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
functions of ScalarEvolution, in preparation for memoization and
other optimizations.
llvm-svn: 119562
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 66a06ae..409d9b5 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -1278,7 +1278,7 @@ Value *SCEVExpander::expand(const SCEV *S) { Instruction *InsertPt = Builder.GetInsertPoint(); for (Loop *L = SE.LI->getLoopFor(Builder.GetInsertBlock()); ; L = L->getParentLoop()) - if (S->isLoopInvariant(L)) { + if (SE.isLoopInvariant(S, L)) { if (!L) break; if (BasicBlock *Preheader = L->getLoopPreheader()) InsertPt = Preheader->getTerminator(); @@ -1286,7 +1286,7 @@ Value *SCEVExpander::expand(const SCEV *S) { // If the SCEV is computable at this level, insert it into the header // after the PHIs (and after any other instructions that we've inserted // there) so that it is guaranteed to dominate any user inside the loop. - if (L && S->hasComputableLoopEvolution(L) && !PostIncLoops.count(L)) + if (L && SE.hasComputableLoopEvolution(S, L) && !PostIncLoops.count(L)) InsertPt = L->getHeader()->getFirstNonPHI(); while (isInsertedInstruction(InsertPt) || isa<DbgInfoIntrinsic>(InsertPt)) InsertPt = llvm::next(BasicBlock::iterator(InsertPt)); |
