diff options
Diffstat (limited to 'test/Transforms/DeadStoreElimination')
17 files changed, 104 insertions, 150 deletions
diff --git a/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll b/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll index 39d5358..7746cce 100644 --- a/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll +++ b/test/Transforms/DeadStoreElimination/2011-03-25-DSEMiscompile.ll @@ -11,10 +11,10 @@ define ghccc void @Func1(i32* noalias %Arg1, i32* noalias %Arg2, i32* %Arg3, i32 entry: store i32 add (i32 ptrtoint ([0 x i32]* @A to i32), i32 1), i32* %Arg2 ; CHECK: store i32 add (i32 ptrtoint ([0 x i32]* @A to i32), i32 1), i32* %Arg2 - %ln2gz = getelementptr i32* %Arg1, i32 14 + %ln2gz = getelementptr i32, i32* %Arg1, i32 14 %ln2gA = bitcast i32* %ln2gz to double* - %ln2gB = load double* %ln2gA - %ln2gD = getelementptr i32* %Arg2, i32 -3 + %ln2gB = load double, double* %ln2gA + %ln2gD = getelementptr i32, i32* %Arg2, i32 -3 %ln2gE = bitcast i32* %ln2gD to double* store double %ln2gB, double* %ln2gE ; CHECK: store double %ln2gB, double* %ln2gE diff --git a/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll b/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll index 95253f6..7e46d28 100644 --- a/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll +++ b/test/Transforms/DeadStoreElimination/2011-09-06-EndOfFunction.ll @@ -10,11 +10,11 @@ define void @_Z3foov(%"class.std::auto_ptr"* noalias nocapture sret %agg.result) _ZNSt8auto_ptrIiED1Ev.exit: %temp.lvalue = alloca %"class.std::auto_ptr", align 8 call void @_Z3barv(%"class.std::auto_ptr"* sret %temp.lvalue) - %_M_ptr.i.i = getelementptr inbounds %"class.std::auto_ptr"* %temp.lvalue, i64 0, i32 0 - %tmp.i.i = load i32** %_M_ptr.i.i, align 8 + %_M_ptr.i.i = getelementptr inbounds %"class.std::auto_ptr", %"class.std::auto_ptr"* %temp.lvalue, i64 0, i32 0 + %tmp.i.i = load i32*, i32** %_M_ptr.i.i, align 8 ; CHECK-NOT: store i32* null store i32* null, i32** %_M_ptr.i.i, align 8 - %_M_ptr.i.i4 = getelementptr inbounds %"class.std::auto_ptr"* %agg.result, i64 0, i32 0 + %_M_ptr.i.i4 = getelementptr inbounds %"class.std::auto_ptr", %"class.std::auto_ptr"* %agg.result, i64 0, i32 0 store i32* %tmp.i.i, i32** %_M_ptr.i.i4, align 8 ; CHECK: ret void ret void diff --git a/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll b/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll index 22b8786..d30e9a2 100644 --- a/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll +++ b/test/Transforms/DeadStoreElimination/2011-09-06-MemCpy.ll @@ -68,13 +68,13 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, define void @_ZSt9iter_swapIPSt4pairIPN4llvm10BasicBlockEjES5_EvT_T0_(%struct.pair.162* %__a, %struct.pair.162* %__b) nounwind uwtable inlinehint { entry: %memtmp = alloca %struct.pair.162, align 8 - %0 = getelementptr inbounds %struct.pair.162* %memtmp, i64 0, i32 0 - %1 = getelementptr inbounds %struct.pair.162* %__a, i64 0, i32 0 - %2 = load %struct.BasicBlock** %1, align 8 + %0 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %memtmp, i64 0, i32 0 + %1 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %__a, i64 0, i32 0 + %2 = load %struct.BasicBlock*, %struct.BasicBlock** %1, align 8 store %struct.BasicBlock* %2, %struct.BasicBlock** %0, align 8 - %3 = getelementptr inbounds %struct.pair.162* %memtmp, i64 0, i32 1 - %4 = getelementptr inbounds %struct.pair.162* %__a, i64 0, i32 1 - %5 = load i32* %4, align 4 + %3 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %memtmp, i64 0, i32 1 + %4 = getelementptr inbounds %struct.pair.162, %struct.pair.162* %__a, i64 0, i32 1 + %5 = load i32, i32* %4, align 4 store i32 %5, i32* %3, align 8 %6 = bitcast %struct.pair.162* %__a to i8* %7 = bitcast %struct.pair.162* %__b to i8* diff --git a/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll b/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll index 968d608..de7a4cc 100644 --- a/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll +++ b/test/Transforms/DeadStoreElimination/OverwriteStoreEnd.ll @@ -10,11 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 define void @write24to28(i32* nocapture %p) nounwind uwtable ssp { ; CHECK-LABEL: @write24to28( entry: - %arrayidx0 = getelementptr inbounds i32* %p, i64 1 + %arrayidx0 = getelementptr inbounds i32, i32* %p, i64 1 %p3 = bitcast i32* %arrayidx0 to i8* ; CHECK: call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 24, i32 4, i1 false) call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 28, i32 4, i1 false) - %arrayidx1 = getelementptr inbounds i32* %p, i64 7 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -25,7 +25,7 @@ entry: %p3 = bitcast i32* %p to i8* ; CHECK: call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 28, i32 4, i1 false) call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 32, i32 4, i1 false) - %arrayidx1 = getelementptr inbounds i32* %p, i64 7 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -36,7 +36,7 @@ entry: %p3 = bitcast i32* %p to i8* ; CHECK: call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 32, i32 16, i1 false) call void @llvm.memset.p0i8.i64(i8* %p3, i8 0, i64 32, i32 16, i1 false) - %arrayidx1 = getelementptr inbounds i32* %p, i64 7 + %arrayidx1 = getelementptr inbounds i32, i32* %p, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -47,7 +47,7 @@ entry: %0 = bitcast %struct.vec2plusi* %p to i8* ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2plusi* @glob2 to i8*), i64 32, i32 16, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2plusi* @glob2 to i8*), i64 36, i32 16, i1 false) - %c = getelementptr inbounds %struct.vec2plusi* %p, i64 0, i32 2 + %c = getelementptr inbounds %struct.vec2plusi, %struct.vec2plusi* %p, i64 0, i32 2 store i32 1, i32* %c, align 4 ret void } @@ -58,7 +58,7 @@ entry: %0 = bitcast %struct.vec2* %p to i8* ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 16, i32 16, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 16, i1 false) - %c = getelementptr inbounds %struct.vec2* %p, i64 0, i32 1 + %c = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 1 store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %c, align 4 ret void } @@ -69,7 +69,7 @@ entry: %0 = bitcast %struct.vec2* %p to i8* ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 16, i1 false) tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* bitcast (%struct.vec2* @glob1 to i8*), i64 32, i32 16, i1 false) - %arrayidx1 = getelementptr inbounds %struct.vec2* %p, i64 0, i32 0, i64 7 + %arrayidx1 = getelementptr inbounds %struct.vec2, %struct.vec2* %p, i64 0, i32 0, i64 7 store i32 1, i32* %arrayidx1, align 4 ret void } @@ -84,12 +84,12 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind define void @cpu_lwp_fork(%struct.trapframe* %md_regs, i64 %pcb_rsp0) nounwind uwtable noinline ssp { entry: %0 = inttoptr i64 %pcb_rsp0 to %struct.trapframe* - %add.ptr = getelementptr inbounds %struct.trapframe* %0, i64 -1 + %add.ptr = getelementptr inbounds %struct.trapframe, %struct.trapframe* %0, i64 -1 %1 = bitcast %struct.trapframe* %add.ptr to i8* %2 = bitcast %struct.trapframe* %md_regs to i8* ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 1, i1 false) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 1, i1 false) - %tf_trapno = getelementptr inbounds %struct.trapframe* %0, i64 -1, i32 1 + %tf_trapno = getelementptr inbounds %struct.trapframe, %struct.trapframe* %0, i64 -1, i32 1 store i64 3, i64* %tf_trapno, align 8 ret void } diff --git a/test/Transforms/DeadStoreElimination/PartialStore.ll b/test/Transforms/DeadStoreElimination/PartialStore.ll index 80c2bfa..d85b4de 100644 --- a/test/Transforms/DeadStoreElimination/PartialStore.ll +++ b/test/Transforms/DeadStoreElimination/PartialStore.ll @@ -30,8 +30,8 @@ define i32 @test3(double %__x) { %__u = alloca { [3 x i32] } %tmp.1 = bitcast { [3 x i32] }* %__u to double* store double %__x, double* %tmp.1 - %tmp.4 = getelementptr { [3 x i32] }* %__u, i32 0, i32 0, i32 1 - %tmp.5 = load i32* %tmp.4 + %tmp.4 = getelementptr { [3 x i32] }, { [3 x i32] }* %__u, i32 0, i32 0, i32 1 + %tmp.5 = load i32, i32* %tmp.4 %tmp.6 = icmp slt i32 %tmp.5, 0 %tmp.7 = zext i1 %tmp.6 to i32 ret i32 %tmp.7 @@ -44,7 +44,7 @@ define void @test4(i8* %P) { ; CHECK-NEXT: store double store i8 19, i8* %P ;; dead - %A = getelementptr i8* %P, i32 3 + %A = getelementptr i8, i8* %P, i32 3 store i8 42, i8* %A ;; dead @@ -58,7 +58,7 @@ declare void @test5a(i32*) define void @test5(i32 %i) nounwind ssp { %A = alloca i32 %B = bitcast i32* %A to i8* - %C = getelementptr i8* %B, i32 %i + %C = getelementptr i8, i8* %B, i32 %i store i8 10, i8* %C ;; Dead store to variable index. store i32 20, i32* %A @@ -74,7 +74,7 @@ declare void @test5a_as1(i32*) define void @test5_addrspacecast(i32 %i) nounwind ssp { %A = alloca i32 %B = addrspacecast i32* %A to i8 addrspace(1)* - %C = getelementptr i8 addrspace(1)* %B, i32 %i + %C = getelementptr i8, i8 addrspace(1)* %B, i32 %i store i8 10, i8 addrspace(1)* %C ;; Dead store to variable index. store i32 20, i32* %A diff --git a/test/Transforms/DeadStoreElimination/atomic.ll b/test/Transforms/DeadStoreElimination/atomic.ll index af303fa..79beee8 100644 --- a/test/Transforms/DeadStoreElimination/atomic.ll +++ b/test/Transforms/DeadStoreElimination/atomic.ll @@ -23,28 +23,6 @@ define void @test1() { ret void } -; DSE across seq_cst load (allowed) -define i32 @test2() { -; CHECK-LABEL: test2 -; CHECK-NOT: store i32 0 -; CHECK: store i32 1 - store i32 0, i32* @x - %x = load atomic i32* @y seq_cst, align 4 - store i32 1, i32* @x - ret i32 %x -} - -; DSE across seq_cst store (allowed) -define void @test3() { -; CHECK-LABEL: test3 -; CHECK-NOT: store i32 0 -; CHECK: store atomic i32 2 - store i32 0, i32* @x - store atomic i32 2, i32* @y seq_cst, align 4 - store i32 1, i32* @x - ret void -} - ; DSE remove unordered store (allowed) define void @test4() { ; CHECK-LABEL: test4 @@ -69,7 +47,7 @@ define void @test6() { ; CHECK-LABEL: test6 ; CHECK-NOT: store ; CHECK: ret void - %x = load atomic i32* @x unordered, align 4 + %x = load atomic i32, i32* @x unordered, align 4 store atomic i32 %x, i32* @x unordered, align 4 ret void } @@ -93,7 +71,7 @@ define i32 @test8() { %a = alloca i32 call void @randomop(i32* %a) store i32 0, i32* %a, align 4 - %x = load atomic i32* @x seq_cst, align 4 + %x = load atomic i32, i32* @x seq_cst, align 4 ret i32 %x } @@ -103,7 +81,7 @@ define i32 @test9() { ; CHECK-NOT: store i32 0 ; CHECK: store i32 1 store i32 0, i32* @x - %x = load atomic i32* @y monotonic, align 4 + %x = load atomic i32, i32* @y monotonic, align 4 store i32 1, i32* @x ret i32 %x } @@ -125,7 +103,7 @@ define i32 @test11() { ; CHECK: store atomic i32 0 ; CHECK: store atomic i32 1 store atomic i32 0, i32* @x monotonic, align 4 - %x = load atomic i32* @y monotonic, align 4 + %x = load atomic i32, i32* @y monotonic, align 4 store atomic i32 1, i32* @x monotonic, align 4 ret i32 %x } @@ -141,30 +119,6 @@ define void @test12() { ret void } -; DSE is allowed across a pair of an atomic read and then write. -define i32 @test13() { -; CHECK-LABEL: test13 -; CHECK-NOT: store i32 0 -; CHECK: store i32 1 - store i32 0, i32* @x - %x = load atomic i32* @y seq_cst, align 4 - store atomic i32 %x, i32* @y seq_cst, align 4 - store i32 1, i32* @x - ret i32 %x -} - -; Same if it is acquire-release instead of seq_cst/seq_cst -define i32 @test14() { -; CHECK-LABEL: test14 -; CHECK-NOT: store i32 0 -; CHECK: store i32 1 - store i32 0, i32* @x - %x = load atomic i32* @y acquire, align 4 - store atomic i32 %x, i32* @y release, align 4 - store i32 1, i32* @x - ret i32 %x -} - ; But DSE is not allowed across a release-acquire pair. define i32 @test15() { ; CHECK-LABEL: test15 @@ -172,7 +126,7 @@ define i32 @test15() { ; CHECK: store i32 1 store i32 0, i32* @x store atomic i32 0, i32* @y release, align 4 - %x = load atomic i32* @y acquire, align 4 + %x = load atomic i32, i32* @y acquire, align 4 store i32 1, i32* @x ret i32 %x } diff --git a/test/Transforms/DeadStoreElimination/const-pointers.ll b/test/Transforms/DeadStoreElimination/const-pointers.ll index 3e772d7..e4403ed 100644 --- a/test/Transforms/DeadStoreElimination/const-pointers.ll +++ b/test/Transforms/DeadStoreElimination/const-pointers.ll @@ -6,10 +6,10 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @g = global i32 42 define void @test1(%t* noalias %pp) { - %p = getelementptr inbounds %t* %pp, i32 0, i32 0 + %p = getelementptr inbounds %t, %t* %pp, i32 0, i32 0 store i32 1, i32* %p; <-- This is dead - %x = load i32* inttoptr (i32 12345 to i32*) + %x = load i32, i32* inttoptr (i32 12345 to i32*) store i32 %x, i32* %p ret void ; CHECK-LABEL: define void @test1( @@ -30,7 +30,7 @@ define void @test3() { define void @test4(i32* %p) { store i32 1, i32* %p - %x = load i32* @g; <-- %p and @g could alias + %x = load i32, i32* @g; <-- %p and @g could alias store i32 %x, i32* %p ret void ; CHECK-LABEL: define void @test4( diff --git a/test/Transforms/DeadStoreElimination/crash.ll b/test/Transforms/DeadStoreElimination/crash.ll index 148695f..78cb842 100644 --- a/test/Transforms/DeadStoreElimination/crash.ll +++ b/test/Transforms/DeadStoreElimination/crash.ll @@ -28,14 +28,14 @@ bb: ; preds = %bb, %entry define fastcc i32 @test2() nounwind ssp { bb14: ; preds = %bb4 %0 = bitcast i8* undef to i8** ; <i8**> [#uses=1] - %1 = getelementptr inbounds i8** %0, i64 undef ; <i8**> [#uses=1] + %1 = getelementptr inbounds i8*, i8** %0, i64 undef ; <i8**> [#uses=1] %2 = bitcast i8** %1 to i16* ; <i16*> [#uses=2] - %3 = getelementptr inbounds i16* %2, i64 undef ; <i16*> [#uses=1] + %3 = getelementptr inbounds i16, i16* %2, i64 undef ; <i16*> [#uses=1] %4 = bitcast i16* %3 to i8* ; <i8*> [#uses=1] - %5 = getelementptr inbounds i8* %4, i64 undef ; <i8*> [#uses=1] - %6 = getelementptr inbounds i16* %2, i64 undef ; <i16*> [#uses=1] + %5 = getelementptr inbounds i8, i8* %4, i64 undef ; <i8*> [#uses=1] + %6 = getelementptr inbounds i16, i16* %2, i64 undef ; <i16*> [#uses=1] store i16 undef, i16* %6, align 2 - %7 = getelementptr inbounds i8* %5, i64 undef ; <i8*> [#uses=1] + %7 = getelementptr inbounds i8, i8* %5, i64 undef ; <i8*> [#uses=1] call void @llvm.memcpy.p0i8.p0i8.i64(i8* %7, i8* undef, i64 undef, i32 1, i1 false) unreachable } @@ -49,8 +49,8 @@ entry: ret i32 0 dead: - %P2 = getelementptr i32 *%P2, i32 52 - %Q2 = getelementptr i32 *%Q2, i32 52 + %P2 = getelementptr i32, i32 *%P2, i32 52 + %Q2 = getelementptr i32, i32 *%Q2, i32 52 store i32 4, i32* %P2 store i32 4, i32* %Q2 br label %dead @@ -65,9 +65,9 @@ dead: define void @test4(%struct.f393a00_2__windmill* %a, %struct.f393a00_2__windmill* %b) { entry: %t = alloca %struct.f393a00_2__windmill ; <%struct.f393a00_2__windmill*> [#uses=1] - %0 = getelementptr %struct.f393a00_2__windmill* %t, i32 0, i32 0, i32 0 ; <%struct.ada__tags__dispatch_table**> [#uses=1] - %1 = load %struct.ada__tags__dispatch_table** null, align 4 ; <%struct.ada__tags__dispatch_table*> [#uses=1] - %2 = load %struct.ada__tags__dispatch_table** %0, align 8 ; <%struct.ada__tags__dispatch_table*> [#uses=1] + %0 = getelementptr %struct.f393a00_2__windmill, %struct.f393a00_2__windmill* %t, i32 0, i32 0, i32 0 ; <%struct.ada__tags__dispatch_table**> [#uses=1] + %1 = load %struct.ada__tags__dispatch_table*, %struct.ada__tags__dispatch_table** null, align 4 ; <%struct.ada__tags__dispatch_table*> [#uses=1] + %2 = load %struct.ada__tags__dispatch_table*, %struct.ada__tags__dispatch_table** %0, align 8 ; <%struct.ada__tags__dispatch_table*> [#uses=1] store %struct.ada__tags__dispatch_table* %2, %struct.ada__tags__dispatch_table** null, align 4 store %struct.ada__tags__dispatch_table* %1, %struct.ada__tags__dispatch_table** null, align 4 ret void diff --git a/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll b/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll index 8953f9c..30bb96f 100644 --- a/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll +++ b/test/Transforms/DeadStoreElimination/cs-cs-aliasing.ll @@ -22,18 +22,18 @@ define weak_odr zeroext i1 @test() #2 align 2 { bb: %tmp = alloca %class.basic_string, align 8 %tmp1 = alloca %class.basic_string, align 8 - %tmp3 = getelementptr inbounds %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 2 + %tmp3 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 2 %tmp4 = bitcast %union.anon* %tmp3 to i8* - %tmp5 = getelementptr inbounds %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 0, i32 0 - %tmp6 = getelementptr inbounds %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 1 - %tmp7 = getelementptr inbounds i8* %tmp4, i64 1 + %tmp5 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 0, i32 0 + %tmp6 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp, i64 0, i32 0, i32 0, i32 1 + %tmp7 = getelementptr inbounds i8, i8* %tmp4, i64 1 %tmp8 = bitcast %class.basic_string* %tmp to i8* %tmp9 = bitcast i64 0 to i64 - %tmp10 = getelementptr inbounds %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 2 + %tmp10 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 2 %tmp11 = bitcast %union.anon* %tmp10 to i8* - %tmp12 = getelementptr inbounds %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 0, i32 0 - %tmp13 = getelementptr inbounds %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 1 - %tmp14 = getelementptr inbounds i8* %tmp11, i64 1 + %tmp12 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 0, i32 0 + %tmp13 = getelementptr inbounds %class.basic_string, %class.basic_string* %tmp1, i64 0, i32 0, i32 0, i32 1 + %tmp14 = getelementptr inbounds i8, i8* %tmp11, i64 1 %tmp15 = bitcast %class.basic_string* %tmp1 to i8* br label %_ZN12basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS2_.exit diff --git a/test/Transforms/DeadStoreElimination/dominate.ll b/test/Transforms/DeadStoreElimination/dominate.ll index 38cf1a0..638992b 100644 --- a/test/Transforms/DeadStoreElimination/dominate.ll +++ b/test/Transforms/DeadStoreElimination/dominate.ll @@ -5,7 +5,7 @@ declare void @bar() define void @foo() { bb1: %memtmp3.i = alloca [21 x i8], align 1 - %0 = getelementptr inbounds [21 x i8]* %memtmp3.i, i64 0, i64 0 + %0 = getelementptr inbounds [21 x i8], [21 x i8]* %memtmp3.i, i64 0, i64 0 br label %bb3 bb2: diff --git a/test/Transforms/DeadStoreElimination/free.ll b/test/Transforms/DeadStoreElimination/free.ll index 1d273d6..6b69ec8 100644 --- a/test/Transforms/DeadStoreElimination/free.ll +++ b/test/Transforms/DeadStoreElimination/free.ll @@ -10,7 +10,7 @@ declare noalias i8* @malloc(i64) ; CHECK-NEXT: @free ; CHECK-NEXT: ret void define void @test(i32* %Q, i32* %P) { - %DEAD = load i32* %Q ; <i32> [#uses=1] + %DEAD = load i32, i32* %Q ; <i32> [#uses=1] store i32 %DEAD, i32* %P %1 = bitcast i32* %P to i8* tail call void @free(i8* %1) @@ -22,7 +22,7 @@ define void @test(i32* %Q, i32* %P) { ; CHECK-NEXT: @free ; CHECK-NEXT: ret void define void @test2({i32, i32}* %P) { - %Q = getelementptr {i32, i32} *%P, i32 0, i32 1 + %Q = getelementptr {i32, i32}, {i32, i32} *%P, i32 0, i32 1 store i32 4, i32* %Q %1 = bitcast {i32, i32}* %P to i8* tail call void @free(i8* %1) @@ -35,7 +35,7 @@ define void @test2({i32, i32}* %P) { define void @test3() { %m = call i8* @malloc(i64 24) store i8 0, i8* %m - %m1 = getelementptr i8* %m, i64 1 + %m1 = getelementptr i8, i8* %m, i64 1 store i8 1, i8* %m1 call void @free(i8* %m) ret void diff --git a/test/Transforms/DeadStoreElimination/inst-limits.ll b/test/Transforms/DeadStoreElimination/inst-limits.ll index 3ef5607..a7b0aeb 100644 --- a/test/Transforms/DeadStoreElimination/inst-limits.ll +++ b/test/Transforms/DeadStoreElimination/inst-limits.ll @@ -118,7 +118,7 @@ entry: ; Insert a meaningless dbg.value intrinsic; it should have no ; effect on the working of DSE in any way. - call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !{}) + call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !MDExpression()) ; CHECK: store i32 -1, i32* @x, align 4 store i32 -1, i32* @x, align 4 @@ -245,18 +245,18 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!11, !13} -!0 = !{!"0x11\004\00clang version 3.4\001\00\000\00\000", !1, !2, !2, !3, !9, !2} ; [ DW_TAG_compile_unit ] [/home/tmp/test.c] [DW_LANG_C99] -!1 = !{!"test.c", !"/home/tmp"} -!2 = !{i32 0} +!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) +!1 = !MDFile(filename: "test.c", directory: "/home/tmp") +!2 = !{} !3 = !{!4} -!4 = !{!"0x2e\00test_within_limit\00test_within_limit\00\003\000\001\000\006\00256\000\004", !1, !5, !6, null, i32 ()* @test_within_limit, null, null, !2} ; [ DW_TAG_subprogram ] [line 3] [def] [scope 4] [test] -!5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [/home/tmp/test.c] -!6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] +!4 = !MDSubprogram(name: "test_within_limit", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 ()* @test_within_limit, variables: !2) +!5 = !MDFile(filename: "test.c", directory: "/home/tmp") +!6 = !MDSubroutineType(types: !7) !7 = !{!8} -!8 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed] +!8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) !9 = !{!10} -!10 = !{!"0x34\00x\00x\00\001\000\001", null, !5, !8, i32* @x, null} ; [ DW_TAG_variable ] [x] [line 1] [def] +!10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", scope: !4, type: !8) !11 = !{i32 2, !"Dwarf Version", i32 4} !12 = !{i32* undef} -!13 = !{i32 1, !"Debug Info Version", i32 2} +!13 = !{i32 1, !"Debug Info Version", i32 3} diff --git a/test/Transforms/DeadStoreElimination/libcalls.ll b/test/Transforms/DeadStoreElimination/libcalls.ll index 6539694..8afa148 100644 --- a/test/Transforms/DeadStoreElimination/libcalls.ll +++ b/test/Transforms/DeadStoreElimination/libcalls.ll @@ -4,7 +4,7 @@ declare i8* @strcpy(i8* %dest, i8* %src) nounwind define void @test1(i8* %src) { ; CHECK-LABEL: @test1( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strcpy %call = call i8* @strcpy(i8* %dest, i8* %src) ; CHECK: ret void @@ -15,7 +15,7 @@ declare i8* @strncpy(i8* %dest, i8* %src, i32 %n) nounwind define void @test2(i8* %src) { ; CHECK-LABEL: @test2( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strncpy %call = call i8* @strncpy(i8* %dest, i8* %src, i32 12) ; CHECK: ret void @@ -26,7 +26,7 @@ declare i8* @strcat(i8* %dest, i8* %src) nounwind define void @test3(i8* %src) { ; CHECK-LABEL: @test3( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strcat %call = call i8* @strcat(i8* %dest, i8* %src) ; CHECK: ret void @@ -37,7 +37,7 @@ declare i8* @strncat(i8* %dest, i8* %src, i32 %n) nounwind define void @test4(i8* %src) { ; CHECK-LABEL: @test4( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK-NOT: @strncat %call = call i8* @strncat(i8* %dest, i8* %src, i32 12) ; CHECK: ret void @@ -47,10 +47,10 @@ define void @test4(i8* %src) { define void @test5(i8* nocapture %src) { ; CHECK-LABEL: @test5( %dest = alloca [100 x i8], align 16 - %arraydecay = getelementptr inbounds [100 x i8]* %dest, i64 0, i64 0 + %arraydecay = getelementptr inbounds [100 x i8], [100 x i8]* %dest, i64 0, i64 0 %call = call i8* @strcpy(i8* %arraydecay, i8* %src) ; CHECK: %call = call i8* @strcpy - %arrayidx = getelementptr inbounds i8* %call, i64 10 + %arrayidx = getelementptr inbounds i8, i8* %call, i64 10 store i8 97, i8* %arrayidx, align 1 ret void } @@ -59,7 +59,7 @@ declare void @user(i8* %p) define void @test6(i8* %src) { ; CHECK-LABEL: @test6( %B = alloca [16 x i8] - %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0 + %dest = getelementptr inbounds [16 x i8], [16 x i8]* %B, i64 0, i64 0 ; CHECK: @strcpy %call = call i8* @strcpy(i8* %dest, i8* %src) ; CHECK: @user diff --git a/test/Transforms/DeadStoreElimination/lifetime.ll b/test/Transforms/DeadStoreElimination/lifetime.ll index 7fe7fbf..305c916 100644 --- a/test/Transforms/DeadStoreElimination/lifetime.ll +++ b/test/Transforms/DeadStoreElimination/lifetime.ll @@ -23,7 +23,7 @@ define void @test1() { define void @test2(i32* %P) { ; CHECK: test2 - %Q = getelementptr i32* %P, i32 1 + %Q = getelementptr i32, i32* %P, i32 1 %R = bitcast i32* %Q to i8* call void @llvm.lifetime.start(i64 4, i8* %R) ; CHECK: lifetime.start diff --git a/test/Transforms/DeadStoreElimination/no-targetdata.ll b/test/Transforms/DeadStoreElimination/no-targetdata.ll index 2539533..f9262ed 100644 --- a/test/Transforms/DeadStoreElimination/no-targetdata.ll +++ b/test/Transforms/DeadStoreElimination/no-targetdata.ll @@ -12,7 +12,7 @@ entry: ; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64 ; CHECK: ret void - %arrayidx = getelementptr i8* %buf, i64 18 + %arrayidx = getelementptr i8, i8* %buf, i64 18 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arrayidx, i8* %buf, i64 18, i32 1, i1 false) store i8 1, i8* %arrayidx, align 1 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %buf, i8* %arrayidx, i64 18, i32 1, i1 false) diff --git a/test/Transforms/DeadStoreElimination/pr11390.ll b/test/Transforms/DeadStoreElimination/pr11390.ll index f63aa1e..faf3b8b 100644 --- a/test/Transforms/DeadStoreElimination/pr11390.ll +++ b/test/Transforms/DeadStoreElimination/pr11390.ll @@ -18,12 +18,12 @@ entry: if.end: ; preds = %entry tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %call4, i8* %name, i64 %call, i32 1, i1 false) - %arrayidx = getelementptr inbounds i8* %call4, i64 %call + %arrayidx = getelementptr inbounds i8, i8* %call4, i64 %call store i8 46, i8* %arrayidx, align 1 ; CHECK: store i8 46 - %add.ptr5 = getelementptr inbounds i8* %call4, i64 %add + %add.ptr5 = getelementptr inbounds i8, i8* %call4, i64 %add tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %add.ptr5, i8* %domain, i64 %call1, i32 1, i1 false) - %arrayidx8 = getelementptr inbounds i8* %call4, i64 %add2 + %arrayidx8 = getelementptr inbounds i8, i8* %call4, i64 %add2 store i8 0, i8* %arrayidx8, align 1 br label %return diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll index 1e81385..dd1443e 100644 --- a/test/Transforms/DeadStoreElimination/simple.ll +++ b/test/Transforms/DeadStoreElimination/simple.ll @@ -6,7 +6,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, declare i8* @llvm.init.trampoline(i8*, i8*, i8*) define void @test1(i32* %Q, i32* %P) { - %DEAD = load i32* %Q + %DEAD = load i32, i32* %Q store i32 %DEAD, i32* %P store i32 0, i32* %P ret void @@ -31,17 +31,17 @@ define void @test2(i32 *%p, i32 *%q) { define i32 @test3(i32* %g_addr) nounwind { ; CHECK-LABEL: @test3( -; CHECK: load i32* %g_addr - %g_value = load i32* %g_addr, align 4 +; CHECK: load i32, i32* %g_addr + %g_value = load i32, i32* %g_addr, align 4 store i32 -1, i32* @g, align 4 store i32 %g_value, i32* %g_addr, align 4 - %tmp3 = load i32* @g, align 4 + %tmp3 = load i32, i32* @g, align 4 ret i32 %tmp3 } define void @test4(i32* %Q) { - %a = load i32* %Q + %a = load i32, i32* %Q store volatile i32 %a, i32* %Q ret void ; CHECK-LABEL: @test4( @@ -51,7 +51,7 @@ define void @test4(i32* %Q) { } define void @test5(i32* %Q) { - %a = load volatile i32* %Q + %a = load volatile i32, i32* %Q store i32 %a, i32* %Q ret void ; CHECK-LABEL: @test5( @@ -87,7 +87,7 @@ define i32 @test8() { store i32 1234567, i32* %V %V2 = bitcast i32* %V to i8* store i8 0, i8* %V2 - %X = load i32* %V + %X = load i32, i32* %V ret i32 %X ; CHECK-LABEL: @test8( @@ -98,7 +98,7 @@ define i32 @test8() { ; Test for byval handling. %struct.x = type { i32, i32, i32, i32 } define void @test9(%struct.x* byval %a) nounwind { - %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 + %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 store i32 1, i32* %tmp2, align 4 ret void ; CHECK-LABEL: @test9( @@ -107,7 +107,7 @@ define void @test9(%struct.x* byval %a) nounwind { ; Test for inalloca handling. define void @test9_2(%struct.x* inalloca %a) nounwind { - %tmp2 = getelementptr %struct.x* %a, i32 0, i32 0 + %tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 store i32 1, i32* %tmp2, align 4 ret void ; CHECK-LABEL: @test9_2( @@ -131,7 +131,7 @@ define void @test11() { ; CHECK-LABEL: @test11( %storage = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1] ; CHECK-NOT: alloca - %cast = getelementptr [10 x i8]* %storage, i32 0, i32 0 ; <i8*> [#uses=1] + %cast = getelementptr [10 x i8], [10 x i8]* %storage, i32 0, i32 0 ; <i8*> [#uses=1] %tramp = call i8* @llvm.init.trampoline( i8* %cast, i8* bitcast (void ()* @test11f to i8*), i8* null ) ; <i8*> [#uses=1] ; CHECK-NOT: trampoline ret void @@ -141,10 +141,10 @@ define void @test11() { ; PR2599 - load -> store to same address. define void @test12({ i32, i32 }* %x) nounwind { - %tmp4 = getelementptr { i32, i32 }* %x, i32 0, i32 0 - %tmp5 = load i32* %tmp4, align 4 - %tmp7 = getelementptr { i32, i32 }* %x, i32 0, i32 1 - %tmp8 = load i32* %tmp7, align 4 + %tmp4 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 0 + %tmp5 = load i32, i32* %tmp4, align 4 + %tmp7 = getelementptr { i32, i32 }, { i32, i32 }* %x, i32 0, i32 1 + %tmp8 = load i32, i32* %tmp7, align 4 %tmp17 = sub i32 0, %tmp8 store i32 %tmp5, i32* %tmp4, align 4 store i32 %tmp17, i32* %tmp7, align 4 @@ -160,7 +160,7 @@ declare void @test13f() define i32* @test13() { %p = tail call i8* @malloc(i32 4) %P = bitcast i8* %p to i32* - %DEAD = load i32* %P + %DEAD = load i32, i32* %P %DEAD2 = add i32 %DEAD, 1 store i32 %DEAD2, i32* %P call void @test13f( ) @@ -176,7 +176,7 @@ define i32 addrspace(1)* @test13_addrspacecast() { %p = tail call i8* @malloc(i32 4) %p.bc = bitcast i8* %p to i32* %P = addrspacecast i32* %p.bc to i32 addrspace(1)* - %DEAD = load i32 addrspace(1)* %P + %DEAD = load i32, i32 addrspace(1)* %P %DEAD2 = add i32 %DEAD, 1 store i32 %DEAD2, i32 addrspace(1)* %P call void @test13f( ) @@ -195,7 +195,7 @@ declare noalias i8* @calloc(i32, i32) define void @test14(i32* %Q) { %P = alloca i32 - %DEAD = load i32* %Q + %DEAD = load i32, i32* %Q store i32 %DEAD, i32* %P ret void @@ -267,7 +267,7 @@ declare void @test19f({i32}* byval align 4 %P) define void @test19({i32} * nocapture byval align 4 %arg5) nounwind ssp { bb: - %tmp7 = getelementptr inbounds {i32}* %arg5, i32 0, i32 0 + %tmp7 = getelementptr inbounds {i32}, {i32}* %arg5, i32 0, i32 0 store i32 912, i32* %tmp7 call void @test19f({i32}* byval align 4 %arg5) ret void @@ -310,9 +310,9 @@ define void @test22(i1 %i, i32 %k, i32 %m) nounwind { declare noalias i8* @strdup(i8* nocapture) nounwind define noalias i8* @test23() nounwind uwtable ssp { %x = alloca [2 x i8], align 1 - %arrayidx = getelementptr inbounds [2 x i8]* %x, i64 0, i64 0 + %arrayidx = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 0 store i8 97, i8* %arrayidx, align 1 - %arrayidx1 = getelementptr inbounds [2 x i8]* %x, i64 0, i64 1 + %arrayidx1 = getelementptr inbounds [2 x i8], [2 x i8]* %x, i64 0, i64 1 store i8 0, i8* %arrayidx1, align 1 %call = call i8* @strdup(i8* %arrayidx) nounwind ret i8* %call @@ -326,13 +326,13 @@ define noalias i8* @test23() nounwind uwtable ssp { ; CHECK: store i32 %c ; CHECK: ret void define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind { - %1 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + %1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 0 store i32 0, i32* %1, align 4 - %2 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + %2 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 1 store i32 0, i32* %2, align 4 - %3 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + %3 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 0 store i32 %b, i32* %3, align 4 - %4 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + %4 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 0, i64 1 store i32 %c, i32* %4, align 4 ret void } @@ -343,8 +343,8 @@ define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind { ; CHECK: store i8 0 ; CHECK: store i8 %tmp define i8* @test25(i8* %p) nounwind { - %p.4 = getelementptr i8* %p, i64 4 - %tmp = load i8* %p.4, align 1 + %p.4 = getelementptr i8, i8* %p, i64 4 + %tmp = load i8, i8* %p.4, align 1 store i8 0, i8* %p.4, align 1 %q = call i8* @strdup(i8* %p) nounwind optsize store i8 %tmp, i8* %p.4, align 1 |