[llvm-commits] [llvm] r145347 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp

Eli Friedman eli.friedman at gmail.com
Mon Nov 28 17:18:23 PST 2011


Author: efriedma
Date: Mon Nov 28 19:18:23 2011
New Revision: 145347

URL: http://llvm.org/viewvc/llvm-project?rev=145347&view=rev
Log:
Zap some completely ridiculous code.  There's probably a miscompile here, but I don't really want to try to write a testcase involving an invoke returning a pointer to a varargs function...


Modified:
    llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp

Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=145347&r1=145346&r2=145347&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Mon Nov 28 19:18:23 2011
@@ -960,7 +960,7 @@
   PointerType *PTy = cast<PointerType>(Callee->getType());
   FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
   if (FTy->isVarArg()) {
-    int ix = FTy->getNumParams() + (isa<InvokeInst>(Callee) ? 2 : 0);
+    int ix = FTy->getNumParams();
     // See if we can optimize any arguments passed through the varargs area of
     // the call.
     for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(),





More information about the llvm-commits mailing list