define i32 @test0(i8* %P) {
%A = alloca i32
call void @external(i32* %A)
-
+
store i32 0, i32* %A
-
+
call void @llvm.memset.p0i8.i32(i8* %P, i8 0, i32 42, i32 1, i1 false)
-
+
%B = load i32* %A
ret i32 %B
-
-; CHECK: @test0
+
+; CHECK-LABEL: @test0
; CHECK: ret i32 0
}
define i8 @test1() {
-; CHECK: @test1
+; CHECK-LABEL: @test1
%A = alloca i8
%B = alloca i8
}
define i8 @test2(i8* %P) {
-; CHECK: @test2
+; CHECK-LABEL: @test2
%P2 = getelementptr i8* %P, i32 127
store i8 1, i8* %P2 ;; Not dead across memset
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false)
}
define i8 @test2a(i8* %P) {
-; CHECK: @test2
+; CHECK-LABEL: @test2
%P2 = getelementptr i8* %P, i32 126
-
+
;; FIXME: DSE isn't zapping this dead store.
store i8 1, i8* %P2 ;; Dead, clobbered by memset.
-
+
call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false)
%A = load i8* %P2
ret i8 %A
}
define void @test3(i8* %P, i8 %X) {
-; CHECK: @test3
+; CHECK-LABEL: @test3
; CHECK-NOT: store
; CHECK-NOT: %Y
%Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead.
-
+
%P2 = getelementptr i8* %P, i32 2
store i8 %Y, i8* %P2 ;; Not read by lifetime.end, should be removed.
; CHECK: store i8 2, i8* %P2
}
define void @test3a(i8* %P, i8 %X) {
-; CHECK: @test3a
+; CHECK-LABEL: @test3a
%Y = add i8 %X, 1 ;; Dead, because the only use (the store) is dead.
-
+
%P2 = getelementptr i8* %P, i32 2
store i8 %Y, i8* %P2
; CHECK-NEXT: call void @llvm.lifetime.end
%tmp2 = load i32* @G1
%sub = sub i32 %tmp2, %tmp
ret i32 %sub
-; CHECK: @test4
+; CHECK-LABEL: @test4
; CHECK-NOT: load
; CHECK: memset.p0i8.i32
; CHECK-NOT: load
%y = load i8* %a
%z = add i8 %x, %y
ret i8 %z
-; CHECK: @test6
+; CHECK-LABEL: @test6
; CHECK: load i8* %a
; CHECK-NOT: load
; CHECK: ret
call void @test7decl(i32* %add.ptr)
%tmp = load i32* %x, align 4
ret i32 %tmp
-; CHECK: @test7(
+; CHECK-LABEL: @test7(
; CHECK: store i32 0
; CHECK: call void @test7decl
; CHECK: load i32*