llvm.org GIT mirror llvm / d0a6a8c
Run dead type elimination after dead argument elimination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105552 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
2 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
11 ; RUN: llvm-dis remove_arguments_test.ll.tmp-reduced-simplified.bc -o - | FileCheck %s
22
33 ; Test to make sure that arguments are removed from the function if they are
4 ; unnecessary.
4 ; unnecessary. And clean up any types that that frees up too.
5
6 ; CHECK: target triple
7 ; CHECK-NOT: struct.anon
8 %struct.anon = type { i32 }
59
610 declare i32 @test2()
711
812 ; CHECK: define void @test() {
9 define i32 @test(i32 %A, i32 %B, float %C) {
13 define i32 @test(i32 %A, %struct.anon* %B, float %C) {
1014 call i32 @test2()
1115 ret i32 %1
1216 }
115115
116116 std::vector CleanupPasses;
117117 CleanupPasses.push_back(getPI(createGlobalDCEPass()));
118 CleanupPasses.push_back(getPI(createDeadTypeEliminationPass()));
119118
120119 if (MayModifySemantics)
121120 CleanupPasses.push_back(getPI(createDeadArgHackingPass()));
122121 else
123122 CleanupPasses.push_back(getPI(createDeadArgEliminationPass()));
123
124 CleanupPasses.push_back(getPI(createDeadTypeEliminationPass()));
124125
125126 Module *New = runPassesOn(M, CleanupPasses);
126127 if (New == 0) {