aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-04 20:54:32 +0000
committerChris Lattner <sabre@nondot.org>2004-12-04 20:54:32 +0000
commit6a1a78a478fc1b0f6a1b236cb5cd0cb95e0f42d4 (patch)
treee7b9a0e452f5980f0f859e8dc16d0854c15867c0
parentedcc6b1e06ddecb85a2df9acc8f389aac9fe9174 (diff)
This patch prevents an infinite recursion while compiling 103.su2cor.
All SPEC CFP 95 programs now work, though the JIT isn't loading -lf2c right so they aren't testing correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18499 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/ScalarEvolution.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index f84c9e9859..757211639b 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -635,8 +635,7 @@ SCEVHandle SCEVAddExpr::get(std::vector<SCEVHandle> &Ops) {
for (unsigned MulOp = 0, e = Mul->getNumOperands(); MulOp != e; ++MulOp) {
SCEV *MulOpSCEV = Mul->getOperand(MulOp);
for (unsigned AddOp = 0, e = Ops.size(); AddOp != e; ++AddOp)
- if (MulOpSCEV == Ops[AddOp] &&
- (Mul->getNumOperands() != 2 || !isa<SCEVConstant>(MulOpSCEV))) {
+ if (MulOpSCEV == Ops[AddOp] && !isa<SCEVConstant>(MulOpSCEV)) {
// Fold W + X + (X * Y * Z) --> W + (X * ((Y*Z)+1))
SCEVHandle InnerMul = Mul->getOperand(MulOp == 0);
if (Mul->getNumOperands() != 2) {
@@ -937,7 +936,8 @@ SCEVHandle SCEVMulExpr::get(std::vector<SCEVHandle> &Ops) {
std::vector<SCEV*> SCEVOps(Ops.begin(), Ops.end());
SCEVCommutativeExpr *&Result = SCEVCommExprs[std::make_pair(scMulExpr,
SCEVOps)];
- if (Result == 0) Result = new SCEVMulExpr(Ops);
+ if (Result == 0)
+ Result = new SCEVMulExpr(Ops);
return Result;
}