Skip to content

Commit 001cda2

Browse files
shiltianIanWood1
authored andcommitted
Reapply "[NFC][AMDGPU] Correct the check line update script for llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit-undefined-behavior.ll"
This reverts commit 74f55c7 with a fix for the check lines.
1 parent aebce1b commit 001cda2

File tree

1 file changed

+96
-4
lines changed

1 file changed

+96
-4
lines changed
Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals all --version 5
22
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=GFX9 %s
33
; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -passes=amdgpu-attributor < %s | FileCheck -check-prefixes=GFX10 %s
44

@@ -10,54 +10,146 @@
1010
;; tests of addrspacecast
1111

1212
define void @with_private_to_flat_addrspacecast(ptr addrspace(5) %ptr) #0 {
13+
; GFX9-LABEL: define void @with_private_to_flat_addrspacecast(
14+
; GFX9-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] {
15+
; GFX9-NEXT: [[STOF:%.*]] = addrspacecast ptr addrspace(5) [[PTR]] to ptr
16+
; GFX9-NEXT: store volatile i32 0, ptr [[STOF]], align 4
17+
; GFX9-NEXT: ret void
18+
;
19+
; GFX10-LABEL: define void @with_private_to_flat_addrspacecast(
20+
; GFX10-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0:[0-9]+]] {
21+
; GFX10-NEXT: [[STOF:%.*]] = addrspacecast ptr addrspace(5) [[PTR]] to ptr
22+
; GFX10-NEXT: store volatile i32 0, ptr [[STOF]], align 4
23+
; GFX10-NEXT: ret void
24+
;
1325
%stof = addrspacecast ptr addrspace(5) %ptr to ptr
1426
store volatile i32 0, ptr %stof
1527
ret void
1628
}
1729

1830
define amdgpu_kernel void @with_private_to_flat_addrspacecast_cc_kernel(ptr addrspace(5) %ptr) #0 {
31+
; GFX9-LABEL: define amdgpu_kernel void @with_private_to_flat_addrspacecast_cc_kernel(
32+
; GFX9-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0]] {
33+
; GFX9-NEXT: [[STOF:%.*]] = addrspacecast ptr addrspace(5) [[PTR]] to ptr
34+
; GFX9-NEXT: store volatile i32 0, ptr [[STOF]], align 4
35+
; GFX9-NEXT: ret void
36+
;
37+
; GFX10-LABEL: define amdgpu_kernel void @with_private_to_flat_addrspacecast_cc_kernel(
38+
; GFX10-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0]] {
39+
; GFX10-NEXT: [[STOF:%.*]] = addrspacecast ptr addrspace(5) [[PTR]] to ptr
40+
; GFX10-NEXT: store volatile i32 0, ptr [[STOF]], align 4
41+
; GFX10-NEXT: ret void
42+
;
1943
%stof = addrspacecast ptr addrspace(5) %ptr to ptr
2044
store volatile i32 0, ptr %stof
2145
ret void
2246
}
2347

2448
define void @call_with_private_to_flat_addrspacecast(ptr addrspace(5) %ptr) #0 {
49+
; GFX9-LABEL: define void @call_with_private_to_flat_addrspacecast(
50+
; GFX9-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0]] {
51+
; GFX9-NEXT: call void @with_private_to_flat_addrspacecast(ptr addrspace(5) [[PTR]])
52+
; GFX9-NEXT: ret void
53+
;
54+
; GFX10-LABEL: define void @call_with_private_to_flat_addrspacecast(
55+
; GFX10-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0]] {
56+
; GFX10-NEXT: call void @with_private_to_flat_addrspacecast(ptr addrspace(5) [[PTR]])
57+
; GFX10-NEXT: ret void
58+
;
2559
call void @with_private_to_flat_addrspacecast(ptr addrspace(5) %ptr)
2660
ret void
2761
}
2862

2963
define amdgpu_kernel void @call_with_private_to_flat_addrspacecast_cc_kernel(ptr addrspace(5) %ptr) #0 {
64+
; GFX9-LABEL: define amdgpu_kernel void @call_with_private_to_flat_addrspacecast_cc_kernel(
65+
; GFX9-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0]] {
66+
; GFX9-NEXT: call void @with_private_to_flat_addrspacecast(ptr addrspace(5) [[PTR]])
67+
; GFX9-NEXT: ret void
68+
;
69+
; GFX10-LABEL: define amdgpu_kernel void @call_with_private_to_flat_addrspacecast_cc_kernel(
70+
; GFX10-SAME: ptr addrspace(5) [[PTR:%.*]]) #[[ATTR0]] {
71+
; GFX10-NEXT: call void @with_private_to_flat_addrspacecast(ptr addrspace(5) [[PTR]])
72+
; GFX10-NEXT: ret void
73+
;
3074
call void @with_private_to_flat_addrspacecast(ptr addrspace(5) %ptr)
3175
ret void
3276
}
3377

3478
;; tests of addrspacecast in a constant
3579

3680
define amdgpu_kernel void @private_constant_expression_use(ptr addrspace(1) nocapture %out) #0 {
81+
; GFX9-LABEL: define amdgpu_kernel void @private_constant_expression_use(
82+
; GFX9-SAME: ptr addrspace(1) captures(none) [[OUT:%.*]]) #[[ATTR0]] {
83+
; GFX9-NEXT: store volatile ptr addrspacecast (ptr addrspace(5) inttoptr (i32 123 to ptr addrspace(5)) to ptr), ptr addrspace(1) [[OUT]], align 8
84+
; GFX9-NEXT: ret void
85+
;
86+
; GFX10-LABEL: define amdgpu_kernel void @private_constant_expression_use(
87+
; GFX10-SAME: ptr addrspace(1) captures(none) [[OUT:%.*]]) #[[ATTR0]] {
88+
; GFX10-NEXT: store volatile ptr addrspacecast (ptr addrspace(5) inttoptr (i32 123 to ptr addrspace(5)) to ptr), ptr addrspace(1) [[OUT]], align 8
89+
; GFX10-NEXT: ret void
90+
;
3791
store volatile ptr addrspacecast (ptr addrspace(5) inttoptr (i32 123 to ptr addrspace(5)) to ptr), ptr addrspace(1) %out, align 8
3892
ret void
3993
}
4094

4195
;; tests of intrinsics
4296

4397
define amdgpu_kernel void @calls_intrin_ascast_cc_kernel(ptr addrspace(3) %ptr) #0 {
98+
; GFX9-LABEL: define amdgpu_kernel void @calls_intrin_ascast_cc_kernel(
99+
; GFX9-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR0]] {
100+
; GFX9-NEXT: [[TMP1:%.*]] = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) [[PTR]])
101+
; GFX9-NEXT: store volatile i32 7, ptr [[TMP1]], align 4
102+
; GFX9-NEXT: ret void
103+
;
104+
; GFX10-LABEL: define amdgpu_kernel void @calls_intrin_ascast_cc_kernel(
105+
; GFX10-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR0]] {
106+
; GFX10-NEXT: [[TMP1:%.*]] = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) [[PTR]])
107+
; GFX10-NEXT: store volatile i32 7, ptr [[TMP1]], align 4
108+
; GFX10-NEXT: ret void
109+
;
44110
%1 = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) %ptr)
45111
store volatile i32 7, ptr %1, align 4
46112
ret void
47113
}
48114

49115
define void @calls_intrin_ascast(ptr addrspace(3) %ptr) #0 {
116+
; GFX9-LABEL: define void @calls_intrin_ascast(
117+
; GFX9-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR0]] {
118+
; GFX9-NEXT: [[TMP1:%.*]] = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) [[PTR]])
119+
; GFX9-NEXT: store volatile i32 7, ptr [[TMP1]], align 4
120+
; GFX9-NEXT: ret void
121+
;
122+
; GFX10-LABEL: define void @calls_intrin_ascast(
123+
; GFX10-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR0]] {
124+
; GFX10-NEXT: [[TMP1:%.*]] = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) [[PTR]])
125+
; GFX10-NEXT: store volatile i32 7, ptr [[TMP1]], align 4
126+
; GFX10-NEXT: ret void
127+
;
50128
%1 = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) %ptr)
51129
store volatile i32 7, ptr %1, align 4
52130
ret void
53131
}
54132

55133
define amdgpu_kernel void @call_calls_intrin_ascast_cc_kernel(ptr addrspace(3) %ptr) #0 {
134+
; GFX9-LABEL: define amdgpu_kernel void @call_calls_intrin_ascast_cc_kernel(
135+
; GFX9-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR0]] {
136+
; GFX9-NEXT: call void @calls_intrin_ascast(ptr addrspace(3) [[PTR]])
137+
; GFX9-NEXT: ret void
138+
;
139+
; GFX10-LABEL: define amdgpu_kernel void @call_calls_intrin_ascast_cc_kernel(
140+
; GFX10-SAME: ptr addrspace(3) [[PTR:%.*]]) #[[ATTR0]] {
141+
; GFX10-NEXT: call void @calls_intrin_ascast(ptr addrspace(3) [[PTR]])
142+
; GFX10-NEXT: ret void
143+
;
56144
call void @calls_intrin_ascast(ptr addrspace(3) %ptr)
57145
ret void
58146
}
59147

60148
attributes #0 = { "amdgpu-no-flat-scratch-init" }
61-
62-
; GFX9: attributes #0 = { "amdgpu-agpr-alloc"="0" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "target-cpu"="gfx900" "uniform-work-group-size"="false" }
63-
; GFX10: attributes #0 = { "amdgpu-agpr-alloc"="0" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "target-cpu"="gfx1010" "uniform-work-group-size"="false" }
149+
;.
150+
; GFX9: attributes #[[ATTR0]] = { "amdgpu-agpr-alloc"="0" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "target-cpu"="gfx900" "uniform-work-group-size"="false" }
151+
; GFX9: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) "target-cpu"="gfx900" }
152+
;.
153+
; GFX10: attributes #[[ATTR0]] = { "amdgpu-agpr-alloc"="0" "amdgpu-no-completion-action" "amdgpu-no-default-queue" "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-flat-scratch-init" "amdgpu-no-heap-ptr" "amdgpu-no-hostcall-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-lds-kernel-id" "amdgpu-no-multigrid-sync-arg" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" "target-cpu"="gfx1010" "uniform-work-group-size"="false" }
154+
; GFX10: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) "target-cpu"="gfx1010" }
155+
;.

0 commit comments

Comments
 (0)