Move LSR's private isZero function to a public SCEV member
function, and make use of it in several places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52463 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index 9872ced..e7bc3f2 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -126,8 +126,7 @@
assert(Ty->isInteger() && "Cannot expand fp recurrences yet!");
// {X,+,F} --> X + {0,+,F}
- if (!isa<SCEVConstant>(S->getStart()) ||
- !cast<SCEVConstant>(S->getStart())->getValue()->isZero()) {
+ if (!S->getStart()->isZero()) {
Value *Start = expand(S->getStart());
std::vector<SCEVHandle> NewOps(S->op_begin(), S->op_end());
NewOps[0] = SE.getIntegerSCEV(0, Ty);