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 | cdfb80de1619a424efbd61b7ded35ee2b870d189 (patch) | |
tree | c7d7f7521bf5c580e400a94a13abfbf8a28453c6 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 3f94a132ddb536857b7bda67c26d0326a26738c3 (diff) | |
download | bcm5719-llvm-cdfb80de1619a424efbd61b7ded35ee2b870d189.tar.gz bcm5719-llvm-cdfb80de1619a424efbd61b7ded35ee2b870d189.zip |
fix ConstantFoldCompareInstOperands to take the LHS/RHS as
individual operands instead of taking a temporary array
llvm-svn: 86619
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 8ead14e9a87..dc993ae5cc1 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/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()); |