[llvm-commits] [llvm] r112638 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Tue Aug 31 13:58:44 PDT 2010
Author: djg
Date: Tue Aug 31 15:58:44 2010
New Revision: 112638
URL: http://llvm.org/viewvc/llvm-project?rev=112638&view=rev
Log:
Revert r112432. It appears to be exposing a problem in the emacs build.
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=112638&r1=112637&r2=112638&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Aug 31 15:58:44 2010
@@ -3332,16 +3332,11 @@
// LLVM IR canonical form means we need only traverse the left operands.
SmallVector<const SCEV *, 4> AddOps;
AddOps.push_back(getSCEV(U->getOperand(1)));
- for (Value *Op = U->getOperand(0); ; Op = U->getOperand(0)) {
- unsigned Opcode = Op->getValueID() - Value::InstructionVal;
- if (Opcode != Instruction::Add && Opcode != Instruction::Sub)
- break;
+ for (Value *Op = U->getOperand(0);
+ Op->getValueID() == Instruction::Add + Value::InstructionVal;
+ Op = U->getOperand(0)) {
U = cast<Operator>(Op);
- const SCEV *Op1 = getSCEV(U->getOperand(1));
- if (Opcode == Instruction::Sub)
- AddOps.push_back(getNegativeSCEV(Op1));
- else
- AddOps.push_back(Op1);
+ AddOps.push_back(getSCEV(U->getOperand(1)));
}
AddOps.push_back(getSCEV(U->getOperand(0)));
return getAddExpr(AddOps);
More information about the llvm-commits
mailing list