summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-07 10:34:03 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-07 10:34:03 +0000
commita22e8148d40b3e68e19182839b2e7031408b4af7 (patch)
treece3d703e76f05d5d3f43402f70bb0f5c1dabeebf /llvm/lib/Analysis/ConstantFolding.cpp
parent90e80efe6b533505c5bdaf52cd8ae2108e7382d6 (diff)
downloadbcm5719-llvm-a22e8148d40b3e68e19182839b2e7031408b4af7.tar.gz
bcm5719-llvm-a22e8148d40b3e68e19182839b2e7031408b4af7.zip
conditionalize by CallInst::ArgOffset
llvm-svn: 107767
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 1f4538ab937..0c4d850b01c 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[0]))
+ if (Function *F = dyn_cast<Function>(Ops[CallInst::ArgOffset ? 0:NumOps-1]))
if (canConstantFoldCallTo(F))
- return ConstantFoldCall(F, Ops+1, NumOps-1);
+ return ConstantFoldCall(F, Ops+CallInst::ArgOffset, NumOps-1);
return 0;
case Instruction::PtrToInt:
// If the input is a inttoptr, eliminate the pair. This requires knowing
OpenPOWER on IntegriCloud