diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-15 18:38:59 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-15 18:38:59 +0000 |
commit | 743e41eae1f3ded4a1d162c6bd8712f5a9750e72 (patch) | |
tree | 7b03de0b108976aaf99a7b0c087c4710564b0a54 /lib/Analysis/IVUsers.cpp | |
parent | f88f21c5d44571ba2962d84e7f0f9c4c7d0fa3ca (diff) | |
download | external_llvm-743e41eae1f3ded4a1d162c6bd8712f5a9750e72.zip external_llvm-743e41eae1f3ded4a1d162c6bd8712f5a9750e72.tar.gz external_llvm-743e41eae1f3ded4a1d162c6bd8712f5a9750e72.tar.bz2 |
Code cleanups. getSCEVAtScope no longer uses SCEVCouldNotCompute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IVUsers.cpp')
-rw-r--r-- | lib/Analysis/IVUsers.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp index 7af9130..4f77641 100644 --- a/lib/Analysis/IVUsers.cpp +++ b/lib/Analysis/IVUsers.cpp @@ -120,9 +120,9 @@ static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L, Loop *UseLoop, // Use getSCEVAtScope to attempt to simplify other loops out of // the picture. SCEVHandle AddRecStart = AddRec->getStart(); - SCEVHandle BetterAddRecStart = SE->getSCEVAtScope(AddRecStart, UseLoop); - if (!isa<SCEVCouldNotCompute>(BetterAddRecStart)) - AddRecStart = BetterAddRecStart; + AddRecStart = SE->getSCEVAtScope(AddRecStart, UseLoop); + SCEVHandle AddRecStride = AddRec->getStepRecurrence(*SE); + AddRecStride = SE->getSCEVAtScope(AddRecStride, UseLoop); // FIXME: If Start contains an SCEVAddRecExpr from a different loop, other // than an outer loop of the current loop, reject it. LSR has no concept of @@ -136,18 +136,18 @@ static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L, Loop *UseLoop, Start = SE->getAddExpr(Start, AddRecStart); - if (!isa<SCEVConstant>(AddRec->getStepRecurrence(*SE))) { - // If stride is an instruction, make sure it dominates the loop preheader. - // Otherwise we could end up with a use before def situation. + // If stride is an instruction, make sure it dominates the loop preheader. + // Otherwise we could end up with a use before def situation. + if (!isa<SCEVConstant>(AddRecStride)) { BasicBlock *Preheader = L->getLoopPreheader(); - if (!AddRec->getStepRecurrence(*SE)->dominates(Preheader, DT)) + if (!AddRecStride->dominates(Preheader, DT)) return false; DOUT << "[" << L->getHeader()->getName() << "] Variable stride: " << *AddRec << "\n"; } - Stride = AddRec->getStepRecurrence(*SE); + Stride = AddRecStride; isSigned = isSExt; return true; } @@ -326,7 +326,7 @@ SCEVHandle IVUsers::getReplacementExpr(const IVStrideUse &U) const { // Evaluate the expression out of the loop, if possible. if (!L->contains(U.getUser()->getParent())) { SCEVHandle ExitVal = SE->getSCEVAtScope(RetVal, L->getParentLoop()); - if (!isa<SCEVCouldNotCompute>(ExitVal) && ExitVal->isLoopInvariant(L)) + if (ExitVal->isLoopInvariant(L)) RetVal = ExitVal; } // Promote the result to the type of the use. |