diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-09 23:06:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-09 23:06:58 +0000 |
commit | 8f73deaa8732a556046bf4ac6207be55972e3b74 (patch) | |
tree | 7f356907bd336592d93b84daccec136f758799e2 /lib/Analysis/ScalarEvolution.cpp | |
parent | 38424c9b5d464d262aa05adfc899285f86b43275 (diff) |
fix ConstantFoldCompareInstOperands to take the LHS/RHS as
individual operands instead of taking a temporary array
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 8ead14e9a8..dc993ae5cc 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -3826,11 +3826,10 @@ static Constant *EvaluateExpression(Value *V, Constant *PHIVal) { } if (const CmpInst *CI = dyn_cast<CmpInst>(I)) - return ConstantFoldCompareInstOperands(CI->getPredicate(), - &Operands[0], Operands.size()); - else - return ConstantFoldInstOperands(I->getOpcode(), I->getType(), - &Operands[0], Operands.size()); + return ConstantFoldCompareInstOperands(CI->getPredicate(), Operands[0], + Operands[1]); + return ConstantFoldInstOperands(I->getOpcode(), I->getType(), + &Operands[0], Operands.size()); } /// getConstantEvolutionLoopExitValue - If we know that the specified Phi is @@ -4037,7 +4036,7 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) { Constant *C; if (const CmpInst *CI = dyn_cast<CmpInst>(I)) C = ConstantFoldCompareInstOperands(CI->getPredicate(), - &Operands[0], Operands.size()); + Operands[0], Operands[1]); else C = ConstantFoldInstOperands(I->getOpcode(), I->getType(), &Operands[0], Operands.size()); |