aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-04-16 23:37:20 +0000
committerEric Christopher <echristo@apple.com>2010-04-16 23:37:20 +0000
commit7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2 (patch)
treec2f3cc1957d7ba72772b73e9f98ca4d55ab5cfdf /llvm/lib/Analysis/ConstantFolding.cpp
parent4ebae65d6af71115de86273e6b27f67e2cde2be7 (diff)
downloadllvm-7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2.zip
llvm-7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2.tar.gz
llvm-7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2.tar.bz2
Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 0723443..37cda02 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -772,9 +772,9 @@ Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy,
case Instruction::ICmp:
case Instruction::FCmp: assert(0 && "Invalid for compares");
case Instruction::Call:
- if (Function *F = dyn_cast<Function>(Ops[NumOps - 1]))
+ if (Function *F = dyn_cast<Function>(Ops[0]))
if (canConstantFoldCallTo(F))
- return ConstantFoldCall(F, Ops, NumOps - 1);
+ return ConstantFoldCall(F, Ops+1, NumOps-1);
return 0;
case Instruction::PtrToInt:
// If the input is a inttoptr, eliminate the pair. This requires knowing