annotate llvm/test/CodeGen/AMDGPU/vector-alloca-atomic.ll @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: opt -S -mtriple=amdgcn-- -data-layout=A5 -amdgpu-promote-alloca -sroa -instcombine < %s | FileCheck -check-prefix=OPT %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 ; Show that what the alloca promotion pass will do for non-atomic load/store.
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 ; OPT-LABEL: @vector_alloca_not_atomic(
anatofuz
parents:
diff changeset
6 ;
anatofuz
parents:
diff changeset
7 ; OPT: extractelement <3 x i32> <i32 0, i32 1, i32 2>, i64 %index
anatofuz
parents:
diff changeset
8 define amdgpu_kernel void @vector_alloca_not_atomic(i32 addrspace(1)* %out, i64 %index) {
anatofuz
parents:
diff changeset
9 entry:
anatofuz
parents:
diff changeset
10 %alloca = alloca [3 x i32], addrspace(5)
anatofuz
parents:
diff changeset
11 %a0 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 0
anatofuz
parents:
diff changeset
12 %a1 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 1
anatofuz
parents:
diff changeset
13 %a2 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 2
anatofuz
parents:
diff changeset
14 store i32 0, i32 addrspace(5)* %a0
anatofuz
parents:
diff changeset
15 store i32 1, i32 addrspace(5)* %a1
anatofuz
parents:
diff changeset
16 store i32 2, i32 addrspace(5)* %a2
anatofuz
parents:
diff changeset
17 %tmp = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i64 0, i64 %index
anatofuz
parents:
diff changeset
18 %data = load i32, i32 addrspace(5)* %tmp
anatofuz
parents:
diff changeset
19 store i32 %data, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
20 ret void
anatofuz
parents:
diff changeset
21 }
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 ; OPT-LABEL: @vector_alloca_atomic_read(
anatofuz
parents:
diff changeset
24 ;
anatofuz
parents:
diff changeset
25 ; OPT: alloca [3 x i32]
anatofuz
parents:
diff changeset
26 ; OPT: store i32 0, i32 addrspace(5)*
anatofuz
parents:
diff changeset
27 ; OPT: store i32 1, i32 addrspace(5)*
anatofuz
parents:
diff changeset
28 ; OPT: store i32 2, i32 addrspace(5)*
anatofuz
parents:
diff changeset
29 ; OPT: load atomic i32, i32 addrspace(5)*
anatofuz
parents:
diff changeset
30 define amdgpu_kernel void @vector_alloca_atomic_read(i32 addrspace(1)* %out, i64 %index) {
anatofuz
parents:
diff changeset
31 entry:
anatofuz
parents:
diff changeset
32 %alloca = alloca [3 x i32], addrspace(5)
anatofuz
parents:
diff changeset
33 %a0 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 0
anatofuz
parents:
diff changeset
34 %a1 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 1
anatofuz
parents:
diff changeset
35 %a2 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 2
anatofuz
parents:
diff changeset
36 store i32 0, i32 addrspace(5)* %a0
anatofuz
parents:
diff changeset
37 store i32 1, i32 addrspace(5)* %a1
anatofuz
parents:
diff changeset
38 store i32 2, i32 addrspace(5)* %a2
anatofuz
parents:
diff changeset
39 %tmp = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i64 0, i64 %index
anatofuz
parents:
diff changeset
40 %data = load atomic i32, i32 addrspace(5)* %tmp acquire, align 4
anatofuz
parents:
diff changeset
41 store i32 %data, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
42 ret void
anatofuz
parents:
diff changeset
43 }
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 ; OPT-LABEL: @vector_alloca_atomic_write(
anatofuz
parents:
diff changeset
46 ;
anatofuz
parents:
diff changeset
47 ; OPT: alloca [3 x i32]
anatofuz
parents:
diff changeset
48 ; OPT: store atomic i32 0, i32 addrspace(5)
anatofuz
parents:
diff changeset
49 ; OPT: store atomic i32 1, i32 addrspace(5)
anatofuz
parents:
diff changeset
50 ; OPT: store atomic i32 2, i32 addrspace(5)
anatofuz
parents:
diff changeset
51 ; OPT: load i32, i32 addrspace(5)*
anatofuz
parents:
diff changeset
52 define amdgpu_kernel void @vector_alloca_atomic_write(i32 addrspace(1)* %out, i64 %index) {
anatofuz
parents:
diff changeset
53 entry:
anatofuz
parents:
diff changeset
54 %alloca = alloca [3 x i32], addrspace(5)
anatofuz
parents:
diff changeset
55 %a0 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 0
anatofuz
parents:
diff changeset
56 %a1 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 1
anatofuz
parents:
diff changeset
57 %a2 = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i32 0, i32 2
anatofuz
parents:
diff changeset
58 store atomic i32 0, i32 addrspace(5)* %a0 release, align 4
anatofuz
parents:
diff changeset
59 store atomic i32 1, i32 addrspace(5)* %a1 release, align 4
anatofuz
parents:
diff changeset
60 store atomic i32 2, i32 addrspace(5)* %a2 release, align 4
anatofuz
parents:
diff changeset
61 %tmp = getelementptr [3 x i32], [3 x i32] addrspace(5)* %alloca, i64 0, i64 %index
anatofuz
parents:
diff changeset
62 %data = load i32, i32 addrspace(5)* %tmp
anatofuz
parents:
diff changeset
63 store i32 %data, i32 addrspace(1)* %out
anatofuz
parents:
diff changeset
64 ret void
anatofuz
parents:
diff changeset
65 }