[llvm-branch-commits] [llvm-branch] r100621 - /llvm/branches/ggreif/CallInst-operands/lib/Analysis/ConstantFolding.cpp

Gabor Greif ggreif at gmail.com
Wed Apr 7 04:43:53 PDT 2010


Author: ggreif
Date: Wed Apr  7 06:43:53 2010
New Revision: 100621

URL: http://llvm.org/viewvc/llvm-project?rev=100621&view=rev
Log:
analyse correct operand range

Modified:
    llvm/branches/ggreif/CallInst-operands/lib/Analysis/ConstantFolding.cpp

Modified: llvm/branches/ggreif/CallInst-operands/lib/Analysis/ConstantFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/CallInst-operands/lib/Analysis/ConstantFolding.cpp?rev=100621&r1=100620&r2=100621&view=diff
==============================================================================
--- llvm/branches/ggreif/CallInst-operands/lib/Analysis/ConstantFolding.cpp (original)
+++ llvm/branches/ggreif/CallInst-operands/lib/Analysis/ConstantFolding.cpp Wed Apr  7 06:43:53 2010
@@ -772,9 +772,9 @@
   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[NumOps - 1]))
       if (canConstantFoldCallTo(F))
-        return ConstantFoldCall(F, Ops+1, NumOps-1);
+        return ConstantFoldCall(F, Ops, NumOps - 1);
     return 0;
   case Instruction::PtrToInt:
     // If the input is a inttoptr, eliminate the pair.  This requires knowing





More information about the llvm-branch-commits mailing list