diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2008-12-06 17:57:05 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2008-12-06 17:57:05 +0000 |
| commit | 1f6a7b500250cfc8c700d73a769b129394f22384 (patch) | |
| tree | 7300c4d743527f4a1ab01d1b9ccf1d454b3c7704 /llvm/lib/Analysis/ScalarEvolution.cpp | |
| parent | 69d78b9d98c3102c5afc9735c298215313caeed2 (diff) | |
| download | bcm5719-llvm-1f6a7b500250cfc8c700d73a769b129394f22384.tar.gz bcm5719-llvm-1f6a7b500250cfc8c700d73a769b129394f22384.zip | |
Minor cleanup. Use dyn_cast, not isa/cast pairs. No functionality change.
llvm-svn: 60623
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 187af66cdb5..2b714de3b3f 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -2911,18 +2911,18 @@ bool ScalarEvolutionsImpl::potentialInfiniteLoop(SCEV *Stride, SCEV *RHS, bool isSigned, bool trueWhenEqual) { // Return true when the distance from RHS to maxint > Stride. - if (!isa<SCEVConstant>(Stride)) + SCEVConstant *SC = dyn_cast<SCEVConstant>(Stride); + if (!SC) return true; - SCEVConstant *SC = cast<SCEVConstant>(Stride); if (SC->getValue()->isZero()) return true; if (!trueWhenEqual && SC->getValue()->isOne()) return false; - if (!isa<SCEVConstant>(RHS)) + SCEVConstant *R = dyn_cast<SCEVConstant>(RHS); + if (!R) return true; - SCEVConstant *R = cast<SCEVConstant>(RHS); if (isSigned) return true; // XXX: because we don't have an sdiv scev. @@ -2983,7 +2983,7 @@ HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, // loop by one iteration. // // The loop won't actually run (m-n)/s times because the loop iterations - // won't divide evenly. For example, if you have {2,+,5} u< 10 the + // might not divide cleanly. For example, if you have {2,+,5} u< 10 the // division would equal one, but the loop runs twice putting the // induction variable at 12. |

