mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
CHECK-LABELize test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217797 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
744742602a
commit
a1e80a1d33
@ -1,5 +1,5 @@
|
||||
; Test that GCSE uses basicaa to do alias analysis, which is capable of
|
||||
; disambiguating some obvious cases. All loads should be removable in
|
||||
; Test that GCSE uses basicaa to do alias analysis, which is capable of
|
||||
; disambiguating some obvious cases. All loads should be removable in
|
||||
; this testcase.
|
||||
|
||||
; RUN: opt < %s -basicaa -gvn -instcombine -dce -S | FileCheck %s
|
||||
|
@ -8,20 +8,20 @@ declare void @external(i32*)
|
||||
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
|
||||
|
||||
@ -35,7 +35,7 @@ define i8 @test1() {
|
||||
}
|
||||
|
||||
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)
|
||||
@ -45,12 +45,12 @@ define i8 @test2(i8* %P) {
|
||||
}
|
||||
|
||||
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
|
||||
@ -59,11 +59,11 @@ define i8 @test2a(i8* %P) {
|
||||
}
|
||||
|
||||
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
|
||||
@ -75,9 +75,9 @@ define void @test3(i8* %P, i8 %X) {
|
||||
}
|
||||
|
||||
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
|
||||
@ -95,7 +95,7 @@ define i32 @test4(i8* %P) {
|
||||
%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
|
||||
@ -123,7 +123,7 @@ define i8 @test6(i8* %p, i8* noalias %a) {
|
||||
%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
|
||||
@ -139,7 +139,7 @@ entry:
|
||||
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*
|
||||
|
Loading…
x
Reference in New Issue
Block a user