From: Chris Lattner Date: Sat, 4 Dec 2004 20:54:32 +0000 (+0000) Subject: This patch prevents an infinite recursion while compiling 103.su2cor. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6a1a78a478fc1b0f6a1b236cb5cd0cb95e0f42d4;p=oota-llvm.git 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 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index f84c9e98593..757211639bf 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -635,8 +635,7 @@ SCEVHandle SCEVAddExpr::get(std::vector &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(MulOpSCEV))) { + if (MulOpSCEV == Ops[AddOp] && !isa(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 &Ops) { std::vector 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; }