1 ; RUN: opt -S -mtriple=amdgcn-- -amdgpu-lower-module-lds < %s | FileCheck %s
2 ; RUN: opt -S -mtriple=amdgcn-- -passes=amdgpu-lower-module-lds < %s | FileCheck %s
4 @a = internal unnamed_addr addrspace(3) global [64 x i32] undef, align 4
5 @b = internal unnamed_addr addrspace(3) global [64 x i32] undef, align 4
7 ; CHECK-LABEL: @no_clobber_ds_load_stores_x2_preexisting_aa
8 ; CHECK: store i32 1, i32 addrspace(3)* %0, align 16, !tbaa !0, !alias.scope !5, !noalias !10
9 ; CHECK: %val.a = load i32, i32 addrspace(3)* %gep.a, align 4, !tbaa !0, !alias.scope !5, !noalias !10
10 ; CHECK: store i32 2, i32 addrspace(3)* %1, align 16, !tbaa !0, !alias.scope !10, !noalias !5
11 ; CHECK: %val.b = load i32, i32 addrspace(3)* %gep.b, align 4, !tbaa !0, !alias.scope !10, !noalias !5
13 define amdgpu_kernel void @no_clobber_ds_load_stores_x2_preexisting_aa(i32 addrspace(1)* %arg, i32 %i) {
15 store i32 1, i32 addrspace(3)* getelementptr inbounds ([64 x i32], [64 x i32] addrspace(3)* @a, i32 0, i32 0), align 4, !alias.scope !0, !noalias !3, !tbaa !5
16 %gep.a = getelementptr inbounds [64 x i32], [64 x i32] addrspace(3)* @a, i32 0, i32 %i
17 %val.a = load i32, i32 addrspace(3)* %gep.a, align 4, !alias.scope !0, !noalias !3, !tbaa !5
18 store i32 2, i32 addrspace(3)* getelementptr inbounds ([64 x i32], [64 x i32] addrspace(3)* @b, i32 0, i32 0), align 4, !alias.scope !3, !noalias !0, !tbaa !5
19 %gep.b = getelementptr inbounds [64 x i32], [64 x i32] addrspace(3)* @b, i32 0, i32 %i
20 %val.b = load i32, i32 addrspace(3)* %gep.b, align 4, !alias.scope !3, !noalias !0, !tbaa !5
21 %val = add i32 %val.a, %val.b
22 store i32 %val, i32 addrspace(1)* %arg, align 4
27 !1 = distinct !{!1, !2}
30 !4 = distinct !{!4, !2}
32 !6 = !{!"no_clobber_ds_load_stores_x2_preexisting_aa", !7, i64 0}
33 !7 = !{!"int", !8, i64 0}
34 !8 = !{!"omnipotent char", !9, i64 0}
35 !9 = !{!"Simple C++ TBAA"}
37 ; CHECK:!0 = !{!1, !2, i64 0}
38 ; CHECK:!1 = !{!"no_clobber_ds_load_stores_x2_preexisting_aa", !2, i64 0}
39 ; CHECK:!2 = !{!"int", !3, i64 0}
40 ; CHECK:!3 = !{!"omnipotent char", !4, i64 0}
41 ; CHECK:!4 = !{!"Simple C++ TBAA"}
42 ; CHECK:!5 = !{!6, !8}
43 ; CHECK:!6 = distinct !{!6, !7}
44 ; CHECK:!7 = distinct !{!7}
45 ; CHECK:!8 = distinct !{!8, !9}
46 ; CHECK:!9 = distinct !{!9}
47 ; CHECK:!10 = !{!11, !12}
48 ; CHECK:!11 = distinct !{!11, !7}
49 ; CHECK:!12 = distinct !{!12, !9}