diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-02-26 18:50:19 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-02-26 18:50:19 +0000 |
| commit | f05d2b31786d76a9776775f40c8b7833290bf7cd (patch) | |
| tree | 2bb796a0f95cddc0779aa973db43ae3100c333f2 /llvm/lib/Analysis/ScalarEvolution.cpp | |
| parent | 67bf757d0aeafd36851ec1537981f2911f750766 (diff) | |
| download | bcm5719-llvm-f05d2b31786d76a9776775f40c8b7833290bf7cd.tar.gz bcm5719-llvm-f05d2b31786d76a9776775f40c8b7833290bf7cd.zip | |
1 + 100 + 51 == 152, not 52.
If we fold three constants together (c1+c2+c3), make sure to keep
LHSC updated, instead of reusing (in this case), the 1 instead of the
partial sum.
llvm-svn: 20337
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index a47bf0d3485..d2331ba3386 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -625,6 +625,7 @@ SCEVHandle SCEVAddExpr::get(std::vector<SCEVHandle> &Ops) { Ops[0] = SCEVConstant::get(CI); Ops.erase(Ops.begin()+1); // Erase the folded element if (Ops.size() == 1) return Ops[0]; + LHSC = cast<SCEVConstant>(Ops[0]); } else { // If we couldn't fold the expression, move to the next constant. Note // that this is impossible to happen in practice because we always @@ -861,6 +862,7 @@ SCEVHandle SCEVMulExpr::get(std::vector<SCEVHandle> &Ops) { Ops[0] = SCEVConstant::get(CI); Ops.erase(Ops.begin()+1); // Erase the folded element if (Ops.size() == 1) return Ops[0]; + LHSC = cast<SCEVConstant>(Ops[0]); } else { // If we couldn't fold the expression, move to the next constant. Note // that this is impossible to happen in practice because we always |

