diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-06-15 06:53:51 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-06-15 06:53:51 +0000 |
commit | aba989f454791a778d9f67ec47374bec01a1331c (patch) | |
tree | 532b7e735897bc9a93ef8d7ecf7cc14ab82d3041 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | a4c2d150d0129364b546ead5785da0ea9e77acae (diff) | |
download | llvm-aba989f454791a778d9f67ec47374bec01a1331c.zip llvm-aba989f454791a778d9f67ec47374bec01a1331c.tar.gz llvm-aba989f454791a778d9f67ec47374bec01a1331c.tar.bz2 |
[SCEV] Use cast<> instead of dyn_cast; NFC
llvm-svn: 272758
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index d797d1a..d215744 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -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) |