forked from OSchip/llvm-project
Minor cleanup. Use dyn_cast, not isa/cast pairs. No functionality change.
llvm-svn: 60623
This commit is contained in:
parent
69d78b9d98
commit
1f6a7b5002
|
@ -2911,18 +2911,18 @@ bool ScalarEvolutionsImpl::potentialInfiniteLoop(SCEV *Stride, SCEV *RHS,
|
||||||
bool isSigned, bool trueWhenEqual) {
|
bool isSigned, bool trueWhenEqual) {
|
||||||
// Return true when the distance from RHS to maxint > Stride.
|
// Return true when the distance from RHS to maxint > Stride.
|
||||||
|
|
||||||
if (!isa<SCEVConstant>(Stride))
|
SCEVConstant *SC = dyn_cast<SCEVConstant>(Stride);
|
||||||
|
if (!SC)
|
||||||
return true;
|
return true;
|
||||||
SCEVConstant *SC = cast<SCEVConstant>(Stride);
|
|
||||||
|
|
||||||
if (SC->getValue()->isZero())
|
if (SC->getValue()->isZero())
|
||||||
return true;
|
return true;
|
||||||
if (!trueWhenEqual && SC->getValue()->isOne())
|
if (!trueWhenEqual && SC->getValue()->isOne())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!isa<SCEVConstant>(RHS))
|
SCEVConstant *R = dyn_cast<SCEVConstant>(RHS);
|
||||||
|
if (!R)
|
||||||
return true;
|
return true;
|
||||||
SCEVConstant *R = cast<SCEVConstant>(RHS);
|
|
||||||
|
|
||||||
if (isSigned)
|
if (isSigned)
|
||||||
return true; // XXX: because we don't have an sdiv scev.
|
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.
|
// loop by one iteration.
|
||||||
//
|
//
|
||||||
// The loop won't actually run (m-n)/s times because the loop iterations
|
// 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
|
// division would equal one, but the loop runs twice putting the
|
||||||
// induction variable at 12.
|
// induction variable at 12.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue