From 4a3136444e7a79a9d0e8c9c67940fa4dcd8f73fe Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sat, 6 Dec 2008 17:57:05 +0000 Subject: [PATCH] Minor cleanup. Use dyn_cast, not isa/cast pairs. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60623 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ScalarEvolution.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 187af66cdb5..2b714de3b3f 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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(Stride)) + SCEVConstant *SC = dyn_cast(Stride); + if (!SC) return true; - SCEVConstant *SC = cast(Stride); if (SC->getValue()->isZero()) return true; if (!trueWhenEqual && SC->getValue()->isOne()) return false; - if (!isa(RHS)) + SCEVConstant *R = dyn_cast(RHS); + if (!R) return true; - SCEVConstant *R = cast(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.