annotate llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.ll @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
2 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck --check-prefix=VARIANT0 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
3 ; RUN: llc -march=amdgcn -mattr=+auto-waitcnt-before-barrier -verify-machineinstrs < %s | FileCheck --check-prefix=VARIANT1 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
4 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck --check-prefix=VARIANT2 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
5 ; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=+auto-waitcnt-before-barrier -verify-machineinstrs < %s | FileCheck --check-prefix=VARIANT3 %s
150
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 define amdgpu_kernel void @test_barrier(i32 addrspace(1)* %out, i32 %size) #0 {
anatofuz
parents:
diff changeset
8 ; VARIANT0-LABEL: test_barrier:
anatofuz
parents:
diff changeset
9 ; VARIANT0: ; %bb.0: ; %entry
anatofuz
parents:
diff changeset
10 ; VARIANT0-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
11 ; VARIANT0-NEXT: s_load_dword s0, s[0:1], 0xb
150
anatofuz
parents:
diff changeset
12 ; VARIANT0-NEXT: s_mov_b32 s7, 0xf000
anatofuz
parents:
diff changeset
13 ; VARIANT0-NEXT: s_mov_b32 s6, 0
anatofuz
parents:
diff changeset
14 ; VARIANT0-NEXT: v_lshlrev_b32_e32 v1, 2, v0
anatofuz
parents:
diff changeset
15 ; VARIANT0-NEXT: v_mov_b32_e32 v2, 0
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
16 ; VARIANT0-NEXT: v_not_b32_e32 v3, v0
150
anatofuz
parents:
diff changeset
17 ; VARIANT0-NEXT: s_waitcnt lgkmcnt(0)
anatofuz
parents:
diff changeset
18 ; VARIANT0-NEXT: buffer_store_dword v0, v[1:2], s[4:7], 0 addr64
anatofuz
parents:
diff changeset
19 ; VARIANT0-NEXT: s_waitcnt vmcnt(0) expcnt(0)
anatofuz
parents:
diff changeset
20 ; VARIANT0-NEXT: s_barrier
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
21 ; VARIANT0-NEXT: v_add_i32_e32 v3, vcc, s0, v3
150
anatofuz
parents:
diff changeset
22 ; VARIANT0-NEXT: v_ashrrev_i32_e32 v4, 31, v3
anatofuz
parents:
diff changeset
23 ; VARIANT0-NEXT: v_lshl_b64 v[3:4], v[3:4], 2
anatofuz
parents:
diff changeset
24 ; VARIANT0-NEXT: buffer_load_dword v0, v[3:4], s[4:7], 0 addr64
anatofuz
parents:
diff changeset
25 ; VARIANT0-NEXT: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
26 ; VARIANT0-NEXT: buffer_store_dword v0, v[1:2], s[4:7], 0 addr64
anatofuz
parents:
diff changeset
27 ; VARIANT0-NEXT: s_endpgm
anatofuz
parents:
diff changeset
28 ;
anatofuz
parents:
diff changeset
29 ; VARIANT1-LABEL: test_barrier:
anatofuz
parents:
diff changeset
30 ; VARIANT1: ; %bb.0: ; %entry
anatofuz
parents:
diff changeset
31 ; VARIANT1-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
32 ; VARIANT1-NEXT: s_load_dword s0, s[0:1], 0xb
150
anatofuz
parents:
diff changeset
33 ; VARIANT1-NEXT: s_mov_b32 s7, 0xf000
anatofuz
parents:
diff changeset
34 ; VARIANT1-NEXT: s_mov_b32 s6, 0
anatofuz
parents:
diff changeset
35 ; VARIANT1-NEXT: v_lshlrev_b32_e32 v1, 2, v0
anatofuz
parents:
diff changeset
36 ; VARIANT1-NEXT: v_mov_b32_e32 v2, 0
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
37 ; VARIANT1-NEXT: v_not_b32_e32 v3, v0
150
anatofuz
parents:
diff changeset
38 ; VARIANT1-NEXT: s_waitcnt lgkmcnt(0)
anatofuz
parents:
diff changeset
39 ; VARIANT1-NEXT: buffer_store_dword v0, v[1:2], s[4:7], 0 addr64
anatofuz
parents:
diff changeset
40 ; VARIANT1-NEXT: s_barrier
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
41 ; VARIANT1-NEXT: v_add_i32_e32 v3, vcc, s0, v3
150
anatofuz
parents:
diff changeset
42 ; VARIANT1-NEXT: v_ashrrev_i32_e32 v4, 31, v3
anatofuz
parents:
diff changeset
43 ; VARIANT1-NEXT: v_lshl_b64 v[3:4], v[3:4], 2
anatofuz
parents:
diff changeset
44 ; VARIANT1-NEXT: s_waitcnt expcnt(0)
anatofuz
parents:
diff changeset
45 ; VARIANT1-NEXT: buffer_load_dword v0, v[3:4], s[4:7], 0 addr64
anatofuz
parents:
diff changeset
46 ; VARIANT1-NEXT: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
47 ; VARIANT1-NEXT: buffer_store_dword v0, v[1:2], s[4:7], 0 addr64
anatofuz
parents:
diff changeset
48 ; VARIANT1-NEXT: s_endpgm
anatofuz
parents:
diff changeset
49 ;
anatofuz
parents:
diff changeset
50 ; VARIANT2-LABEL: test_barrier:
anatofuz
parents:
diff changeset
51 ; VARIANT2: ; %bb.0: ; %entry
anatofuz
parents:
diff changeset
52 ; VARIANT2-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
53 ; VARIANT2-NEXT: s_load_dword s4, s[0:1], 0x2c
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
54 ; VARIANT2-NEXT: v_lshlrev_b32_e32 v2, 2, v0
150
anatofuz
parents:
diff changeset
55 ; VARIANT2-NEXT: s_waitcnt lgkmcnt(0)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
56 ; VARIANT2-NEXT: global_store_dword v2, v0, s[2:3]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
57 ; VARIANT2-NEXT: v_xad_u32 v0, v0, -1, s4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
58 ; VARIANT2-NEXT: v_ashrrev_i32_e32 v1, 31, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
59 ; VARIANT2-NEXT: v_lshlrev_b64 v[0:1], 2, v[0:1]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
60 ; VARIANT2-NEXT: v_mov_b32_e32 v3, s3
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
61 ; VARIANT2-NEXT: v_add_co_u32_e32 v0, vcc, s2, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
62 ; VARIANT2-NEXT: v_addc_co_u32_e32 v1, vcc, v3, v1, vcc
150
anatofuz
parents:
diff changeset
63 ; VARIANT2-NEXT: s_waitcnt vmcnt(0)
anatofuz
parents:
diff changeset
64 ; VARIANT2-NEXT: s_barrier
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
65 ; VARIANT2-NEXT: global_load_dword v0, v[0:1], off
150
anatofuz
parents:
diff changeset
66 ; VARIANT2-NEXT: s_waitcnt vmcnt(0)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
67 ; VARIANT2-NEXT: global_store_dword v2, v0, s[2:3]
150
anatofuz
parents:
diff changeset
68 ; VARIANT2-NEXT: s_endpgm
anatofuz
parents:
diff changeset
69 ;
anatofuz
parents:
diff changeset
70 ; VARIANT3-LABEL: test_barrier:
anatofuz
parents:
diff changeset
71 ; VARIANT3: ; %bb.0: ; %entry
anatofuz
parents:
diff changeset
72 ; VARIANT3-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
73 ; VARIANT3-NEXT: s_load_dword s4, s[0:1], 0x2c
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
74 ; VARIANT3-NEXT: v_lshlrev_b32_e32 v2, 2, v0
150
anatofuz
parents:
diff changeset
75 ; VARIANT3-NEXT: s_waitcnt lgkmcnt(0)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
76 ; VARIANT3-NEXT: global_store_dword v2, v0, s[2:3]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
77 ; VARIANT3-NEXT: v_xad_u32 v0, v0, -1, s4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
78 ; VARIANT3-NEXT: v_ashrrev_i32_e32 v1, 31, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
79 ; VARIANT3-NEXT: v_lshlrev_b64 v[0:1], 2, v[0:1]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
80 ; VARIANT3-NEXT: v_mov_b32_e32 v3, s3
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
81 ; VARIANT3-NEXT: v_add_co_u32_e32 v0, vcc, s2, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
82 ; VARIANT3-NEXT: v_addc_co_u32_e32 v1, vcc, v3, v1, vcc
150
anatofuz
parents:
diff changeset
83 ; VARIANT3-NEXT: s_barrier
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
84 ; VARIANT3-NEXT: global_load_dword v0, v[0:1], off
150
anatofuz
parents:
diff changeset
85 ; VARIANT3-NEXT: s_waitcnt vmcnt(0)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 173
diff changeset
86 ; VARIANT3-NEXT: global_store_dword v2, v0, s[2:3]
150
anatofuz
parents:
diff changeset
87 ; VARIANT3-NEXT: s_endpgm
anatofuz
parents:
diff changeset
88 entry:
anatofuz
parents:
diff changeset
89 %tmp = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
90 %tmp1 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp
anatofuz
parents:
diff changeset
91 store i32 %tmp, i32 addrspace(1)* %tmp1
anatofuz
parents:
diff changeset
92 call void @llvm.amdgcn.s.barrier()
anatofuz
parents:
diff changeset
93 %tmp3 = sub i32 %size, 1
anatofuz
parents:
diff changeset
94 %tmp4 = sub i32 %tmp3, %tmp
anatofuz
parents:
diff changeset
95 %tmp5 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp4
anatofuz
parents:
diff changeset
96 %tmp6 = load i32, i32 addrspace(1)* %tmp5
anatofuz
parents:
diff changeset
97 store i32 %tmp6, i32 addrspace(1)* %tmp1
anatofuz
parents:
diff changeset
98 ret void
anatofuz
parents:
diff changeset
99 }
anatofuz
parents:
diff changeset
100
anatofuz
parents:
diff changeset
101 declare void @llvm.amdgcn.s.barrier() #1
anatofuz
parents:
diff changeset
102 declare i32 @llvm.amdgcn.workitem.id.x() #2
anatofuz
parents:
diff changeset
103
anatofuz
parents:
diff changeset
104 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
105 attributes #1 = { convergent nounwind }
anatofuz
parents:
diff changeset
106 attributes #2 = { nounwind readnone }