[llvm] r272758 - [SCEV] Use cast<> instead of dyn_cast; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 14 23:53:52 PDT 2016
Author: sanjoy
Date: Wed Jun 15 01:53:51 2016
New Revision: 272758
URL: http://llvm.org/viewvc/llvm-project?rev=272758&view=rev
Log:
[SCEV] Use cast<> instead of dyn_cast; NFC
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=272758&r1=272757&r2=272758&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Jun 15 01:53:51 2016
@@ -8674,8 +8674,7 @@ ScalarEvolution::howManyLessThans(const
// 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(con
// 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)
More information about the llvm-commits
mailing list