]> granicus.if.org Git - llvm/commitdiff
[SCEV] Use cast<> instead of dyn_cast; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 15 Jun 2016 06:53:51 +0000 (06:53 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 15 Jun 2016 06:53:51 +0000 (06:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272758 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index d797d1a0f3fbb5894244c3140b8fdab2808adab5..d2157443b24af8f7dc76702783b15691c7b628be 100644 (file)
@@ -8674,8 +8674,7 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
     // overflow, in which case if RHS - Start is a constant, we don't need to
     // do a max operation since we can just figure it out statically
     if (NoWrap && isa<SCEVConstant>(Diff)) {
-      APInt D = dyn_cast<const SCEVConstant>(Diff)->getAPInt();
-      if (D.isNegative())
+      if (cast<SCEVConstant>(Diff)->getAPInt().isNegative())
         End = Start;
     } else
       End = IsSigned ? getSMaxExpr(RHS, Start)
@@ -8761,8 +8760,7 @@ ScalarEvolution::howManyGreaterThans(const SCEV *LHS, const SCEV *RHS,
     // overflow, in which case if RHS - Start is a constant, we don't need to
     // do a max operation since we can just figure it out statically
     if (NoWrap && isa<SCEVConstant>(Diff)) {
-      APInt D = dyn_cast<const SCEVConstant>(Diff)->getAPInt();
-      if (!D.isNegative())
+      if (!cast<SCEVConstant>(Diff)->getAPInt().isNegative())
         End = Start;
     } else
       End = IsSigned ? getSMinExpr(RHS, Start)