[llvm-commits] [llvm] r105551 - in /llvm/trunk: lib/Transforms/IPO/DeadArgumentElimination.cpp test/BugPoint/remove_arguments_test.ll

Dan Gohman gohman at apple.com
Mon Jun 7 13:20:33 PDT 2010


Author: djg
Date: Mon Jun  7 15:20:33 2010
New Revision: 105551

URL: http://llvm.org/viewvc/llvm-project?rev=105551&view=rev
Log:
Make bugpoint dead-argument-hacking actually work, and actually test it.

Modified:
    llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
    llvm/trunk/test/BugPoint/remove_arguments_test.ll

Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=105551&r1=105550&r2=105551&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Mon Jun  7 15:20:33 2010
@@ -120,9 +120,14 @@
 
     typedef SmallVector<RetOrArg, 5> UseVector;
 
+  protected:
+    // DAH uses this to specify a different ID.
+    explicit DAE(void *ID) : ModulePass(ID) {}
+
   public:
     static char ID; // Pass identification, replacement for typeid
     DAE() : ModulePass(&ID) {}
+
     bool runOnModule(Module &M);
 
     virtual bool ShouldHackArguments() const { return false; }
@@ -155,6 +160,8 @@
   /// by bugpoint.
   struct DAH : public DAE {
     static char ID;
+    DAH() : DAE(&ID) {}
+
     virtual bool ShouldHackArguments() const { return true; }
   };
 }

Modified: llvm/trunk/test/BugPoint/remove_arguments_test.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/remove_arguments_test.ll?rev=105551&r1=105550&r2=105551&view=diff
==============================================================================
--- llvm/trunk/test/BugPoint/remove_arguments_test.ll (original)
+++ llvm/trunk/test/BugPoint/remove_arguments_test.ll Mon Jun  7 15:20:33 2010
@@ -1,10 +1,12 @@
 ; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes
+; RUN: llvm-dis remove_arguments_test.ll.tmp-reduced-simplified.bc -o - | FileCheck %s
 
 ; Test to make sure that arguments are removed from the function if they are 
 ; unnecessary.
 
 declare i32 @test2()
 
+; CHECK: define void @test() {
 define i32 @test(i32 %A, i32 %B, float %C) {
 	call i32 @test2()
 	ret i32 %1





More information about the llvm-commits mailing list