annotate llvm/test/CodeGen/AMDGPU/cluster_stores.ll @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
2 ; RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=-xnack -verify-machineinstrs -debug-only=machine-scheduler < %s 2> %t | FileCheck --enable-var-scope --check-prefix=GFX9 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 ; RUN: FileCheck --enable-var-scope --check-prefix=DBG %s < %t
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 ; RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -debug-only=machine-scheduler < %s 2> %t | FileCheck --enable-var-scope --check-prefix=GFX10 %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 ; RUN: FileCheck --enable-var-scope --check-prefix=DBG %s < %t
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
6 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs -debug-only=machine-scheduler < %s 2> %t | FileCheck --enable-var-scope --check-prefix=GFX11 %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
7 ; RUN: FileCheck --enable-var-scope --check-prefixes=DBG,DBG11 %s < %t
150
anatofuz
parents:
diff changeset
8 ; REQUIRES: asserts
anatofuz
parents:
diff changeset
9
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 ; FIXME: Verifier error with xnack enabled.
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
12 ; DBG-LABEL: cluster_load_cluster_store:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
13
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
14 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
15 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
16 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
17 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
18 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
19
150
anatofuz
parents:
diff changeset
20 ; DBG: Cluster ld/st SU([[L1:[0-9]+]]) - SU([[L2:[0-9]+]])
anatofuz
parents:
diff changeset
21 ; DBG: Cluster ld/st SU([[L2]]) - SU([[L3:[0-9]+]])
anatofuz
parents:
diff changeset
22 ; DBG: Cluster ld/st SU([[L3]]) - SU([[L4:[0-9]+]])
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
23
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
24 ; DBG11: Cluster ld/st SU([[S1:[0-9]+]]) - SU([[S2:[0-9]+]])
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
25 ; DBG11: Cluster ld/st SU([[S2]]) - SU([[S3:[0-9]+]])
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
26 ; DBG11: Cluster ld/st SU([[S3]]) - SU([[S4:[0-9]+]])
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
27
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
28 ; DBG-NOT: Cluster ld/st
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
29
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
30 define amdgpu_kernel void @cluster_load_cluster_store(ptr noalias %lb, ptr noalias %sb) {
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
31 ; GFX9-LABEL: cluster_load_cluster_store:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
32 ; GFX9: ; %bb.0: ; %bb
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
33 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
34 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
35 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
36 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
37 ; GFX9-NEXT: flat_load_dword v2, v[0:1]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
38 ; GFX9-NEXT: flat_load_dword v3, v[0:1] offset:8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
39 ; GFX9-NEXT: flat_load_dword v4, v[0:1] offset:16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
40 ; GFX9-NEXT: flat_load_dword v5, v[0:1] offset:24
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
41 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
42 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
43 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
44 ; GFX9-NEXT: flat_store_dword v[0:1], v2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
45 ; GFX9-NEXT: flat_store_dword v[0:1], v3 offset:8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
46 ; GFX9-NEXT: flat_store_dword v[0:1], v4 offset:16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
47 ; GFX9-NEXT: flat_store_dword v[0:1], v5 offset:24
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
48 ; GFX9-NEXT: s_endpgm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
49 ;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
50 ; GFX10-LABEL: cluster_load_cluster_store:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
51 ; GFX10: ; %bb.0: ; %bb
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
52 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
53 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
54 ; GFX10-NEXT: s_add_u32 s4, s0, 8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
55 ; GFX10-NEXT: s_addc_u32 s5, s1, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
56 ; GFX10-NEXT: s_add_u32 s6, s0, 16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
57 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
58 ; GFX10-NEXT: s_addc_u32 s7, s1, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
59 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
60 ; GFX10-NEXT: s_add_u32 s0, s0, 24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
61 ; GFX10-NEXT: v_mov_b32_e32 v2, s4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
62 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
63 ; GFX10-NEXT: v_mov_b32_e32 v3, s5
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
64 ; GFX10-NEXT: v_mov_b32_e32 v4, s6
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
65 ; GFX10-NEXT: v_mov_b32_e32 v5, s7
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
66 ; GFX10-NEXT: v_mov_b32_e32 v7, s1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
67 ; GFX10-NEXT: v_mov_b32_e32 v6, s0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
68 ; GFX10-NEXT: s_clause 0x3
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
69 ; GFX10-NEXT: flat_load_dword v8, v[0:1]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
70 ; GFX10-NEXT: flat_load_dword v9, v[2:3]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
71 ; GFX10-NEXT: flat_load_dword v10, v[4:5]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
72 ; GFX10-NEXT: flat_load_dword v11, v[6:7]
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
73 ; GFX10-NEXT: s_add_u32 s0, s2, 8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
74 ; GFX10-NEXT: s_addc_u32 s1, s3, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
75 ; GFX10-NEXT: v_mov_b32_e32 v0, s2
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
76 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
77 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
78 ; GFX10-NEXT: s_add_u32 s0, s2, 16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
79 ; GFX10-NEXT: s_addc_u32 s1, s3, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
80 ; GFX10-NEXT: v_mov_b32_e32 v1, s3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
81 ; GFX10-NEXT: s_add_u32 s2, s2, 24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
82 ; GFX10-NEXT: s_addc_u32 s3, s3, 0
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
83 ; GFX10-NEXT: v_mov_b32_e32 v5, s1
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
84 ; GFX10-NEXT: v_mov_b32_e32 v4, s0
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
85 ; GFX10-NEXT: v_mov_b32_e32 v7, s3
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
86 ; GFX10-NEXT: v_mov_b32_e32 v6, s2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
87 ; GFX10-NEXT: s_waitcnt vmcnt(3) lgkmcnt(3)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
88 ; GFX10-NEXT: flat_store_dword v[0:1], v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
89 ; GFX10-NEXT: s_waitcnt vmcnt(2) lgkmcnt(3)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
90 ; GFX10-NEXT: flat_store_dword v[2:3], v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
91 ; GFX10-NEXT: s_waitcnt vmcnt(1) lgkmcnt(3)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
92 ; GFX10-NEXT: flat_store_dword v[4:5], v10
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
93 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(3)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
94 ; GFX10-NEXT: flat_store_dword v[6:7], v11
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
95 ; GFX10-NEXT: s_endpgm
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
96 ;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
97 ; GFX11-LABEL: cluster_load_cluster_store:
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
98 ; GFX11: ; %bb.0: ; %bb
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
99 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
100 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
101 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
102 ; GFX11-NEXT: s_clause 0x3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
103 ; GFX11-NEXT: flat_load_b32 v2, v[0:1]
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
104 ; GFX11-NEXT: flat_load_b32 v3, v[0:1] offset:8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
105 ; GFX11-NEXT: flat_load_b32 v4, v[0:1] offset:16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
106 ; GFX11-NEXT: flat_load_b32 v5, v[0:1] offset:24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
107 ; GFX11-NEXT: v_dual_mov_b32 v0, s2 :: v_dual_mov_b32 v1, s3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
108 ; GFX11-NEXT: s_waitcnt vmcnt(3) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
109 ; GFX11-NEXT: flat_store_b32 v[0:1], v2
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
110 ; GFX11-NEXT: s_waitcnt vmcnt(2) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
111 ; GFX11-NEXT: flat_store_b32 v[0:1], v3 offset:8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
112 ; GFX11-NEXT: s_waitcnt vmcnt(1) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
113 ; GFX11-NEXT: flat_store_b32 v[0:1], v4 offset:16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
114 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
115 ; GFX11-NEXT: flat_store_b32 v[0:1], v5 offset:24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
116 ; GFX11-NEXT: s_endpgm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
117 bb:
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
118 %ld0 = load i32, ptr %lb
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
119 %la1 = getelementptr inbounds i32, ptr %lb, i32 2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
120 %ld1 = load i32, ptr %la1
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
121 %la2 = getelementptr inbounds i32, ptr %lb, i32 4
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
122 %ld2 = load i32, ptr %la2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
123 %la3 = getelementptr inbounds i32, ptr %lb, i32 6
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
124 %ld3 = load i32, ptr %la3
150
anatofuz
parents:
diff changeset
125
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
126 store i32 %ld0, ptr %sb
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
127 %sa1 = getelementptr inbounds i32, ptr %sb, i32 2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
128 store i32 %ld1, ptr %sa1
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
129 %sa2 = getelementptr inbounds i32, ptr %sb, i32 4
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
130 store i32 %ld2, ptr %sa2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
131 %sa3 = getelementptr inbounds i32, ptr %sb, i32 6
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
132 store i32 %ld3, ptr %sa3
150
anatofuz
parents:
diff changeset
133
anatofuz
parents:
diff changeset
134 ret void
anatofuz
parents:
diff changeset
135 }
anatofuz
parents:
diff changeset
136
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
137 ; DBG-LABEL: cluster_load_valu_cluster_store:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
138
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
139 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
140 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
141 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
142 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
143 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
144
150
anatofuz
parents:
diff changeset
145 ; DBG: Cluster ld/st SU([[L1:[0-9]+]]) - SU([[L2:[0-9]+]])
anatofuz
parents:
diff changeset
146 ; DBG: Cluster ld/st SU([[L2]]) - SU([[L3:[0-9]+]])
anatofuz
parents:
diff changeset
147 ; DBG: Cluster ld/st SU([[L3]]) - SU([[L4:[0-9]+]])
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
148
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
149 ; DBG11: Cluster ld/st SU([[S1:[0-9]+]]) - SU([[S2:[0-9]+]])
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
150 ; DBG11: Cluster ld/st SU([[S2]]) - SU([[S3:[0-9]+]])
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
151 ; DBG11: Cluster ld/st SU([[S3]]) - SU([[S4:[0-9]+]])
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
152
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
153 ; DBG-NOT: Cluster ld/st
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
154
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
155 define amdgpu_kernel void @cluster_load_valu_cluster_store(ptr noalias %lb, ptr noalias %sb) {
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
156 ; GFX9-LABEL: cluster_load_valu_cluster_store:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
157 ; GFX9: ; %bb.0: ; %bb
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
158 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
159 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
160 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
161 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
162 ; GFX9-NEXT: flat_load_dword v2, v[0:1]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
163 ; GFX9-NEXT: flat_load_dword v3, v[0:1] offset:8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
164 ; GFX9-NEXT: flat_load_dword v4, v[0:1] offset:16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
165 ; GFX9-NEXT: flat_load_dword v5, v[0:1] offset:24
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
166 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
167 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
168 ; GFX9-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
169 ; GFX9-NEXT: flat_store_dword v[0:1], v2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
170 ; GFX9-NEXT: v_add_u32_e32 v2, 1, v3
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
171 ; GFX9-NEXT: flat_store_dword v[0:1], v4 offset:16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
172 ; GFX9-NEXT: flat_store_dword v[0:1], v2 offset:8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
173 ; GFX9-NEXT: flat_store_dword v[0:1], v5 offset:24
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
174 ; GFX9-NEXT: s_endpgm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
175 ;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
176 ; GFX10-LABEL: cluster_load_valu_cluster_store:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
177 ; GFX10: ; %bb.0: ; %bb
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
178 ; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
179 ; GFX10-NEXT: s_waitcnt lgkmcnt(0)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
180 ; GFX10-NEXT: s_add_u32 s4, s0, 8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
181 ; GFX10-NEXT: s_addc_u32 s5, s1, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
182 ; GFX10-NEXT: v_mov_b32_e32 v2, s4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
183 ; GFX10-NEXT: s_add_u32 s6, s0, 16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
184 ; GFX10-NEXT: v_mov_b32_e32 v3, s5
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
185 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
186 ; GFX10-NEXT: s_addc_u32 s7, s1, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
187 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
188 ; GFX10-NEXT: s_add_u32 s0, s0, 24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
189 ; GFX10-NEXT: s_addc_u32 s1, s1, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
190 ; GFX10-NEXT: v_mov_b32_e32 v4, s6
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
191 ; GFX10-NEXT: v_mov_b32_e32 v5, s7
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
192 ; GFX10-NEXT: flat_load_dword v6, v[2:3]
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
193 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
194 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
195 ; GFX10-NEXT: s_clause 0x2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
196 ; GFX10-NEXT: flat_load_dword v8, v[0:1]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
197 ; GFX10-NEXT: flat_load_dword v9, v[4:5]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
198 ; GFX10-NEXT: flat_load_dword v10, v[2:3]
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
199 ; GFX10-NEXT: s_add_u32 s0, s2, 8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
200 ; GFX10-NEXT: s_addc_u32 s1, s3, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
201 ; GFX10-NEXT: s_add_u32 s4, s2, 16
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
202 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
203 ; GFX10-NEXT: s_addc_u32 s5, s3, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
204 ; GFX10-NEXT: v_mov_b32_e32 v0, s2
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
205 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
206 ; GFX10-NEXT: s_add_u32 s0, s2, 24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
207 ; GFX10-NEXT: v_mov_b32_e32 v1, s3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
208 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
209 ; GFX10-NEXT: s_addc_u32 s1, s3, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
210 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
211 ; GFX10-NEXT: s_waitcnt vmcnt(3) lgkmcnt(3)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
212 ; GFX10-NEXT: v_add_nc_u32_e32 v11, 1, v6
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
213 ; GFX10-NEXT: v_mov_b32_e32 v7, s1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
214 ; GFX10-NEXT: v_mov_b32_e32 v6, s0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
215 ; GFX10-NEXT: s_waitcnt vmcnt(2) lgkmcnt(2)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
216 ; GFX10-NEXT: flat_store_dword v[0:1], v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
217 ; GFX10-NEXT: s_waitcnt vmcnt(1) lgkmcnt(2)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
218 ; GFX10-NEXT: flat_store_dword v[4:5], v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
219 ; GFX10-NEXT: flat_store_dword v[2:3], v11
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
220 ; GFX10-NEXT: s_waitcnt vmcnt(0) lgkmcnt(3)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
221 ; GFX10-NEXT: flat_store_dword v[6:7], v10
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
222 ; GFX10-NEXT: s_endpgm
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
223 ;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
224 ; GFX11-LABEL: cluster_load_valu_cluster_store:
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
225 ; GFX11: ; %bb.0: ; %bb
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
226 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
227 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
228 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
229 ; GFX11-NEXT: s_clause 0x3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
230 ; GFX11-NEXT: flat_load_b32 v2, v[0:1] offset:8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
231 ; GFX11-NEXT: flat_load_b32 v3, v[0:1]
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
232 ; GFX11-NEXT: flat_load_b32 v4, v[0:1] offset:16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
233 ; GFX11-NEXT: flat_load_b32 v5, v[0:1] offset:24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
234 ; GFX11-NEXT: v_dual_mov_b32 v0, s2 :: v_dual_mov_b32 v1, s3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
235 ; GFX11-NEXT: s_waitcnt vmcnt(3) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
236 ; GFX11-NEXT: v_add_nc_u32_e32 v2, 1, v2
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
237 ; GFX11-NEXT: s_waitcnt vmcnt(2) lgkmcnt(2)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
238 ; GFX11-NEXT: s_clause 0x1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
239 ; GFX11-NEXT: flat_store_b32 v[0:1], v3
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
240 ; GFX11-NEXT: flat_store_b32 v[0:1], v2 offset:8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
241 ; GFX11-NEXT: s_waitcnt vmcnt(1) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
242 ; GFX11-NEXT: flat_store_b32 v[0:1], v4 offset:16
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
243 ; GFX11-NEXT: s_waitcnt vmcnt(0) lgkmcnt(3)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
244 ; GFX11-NEXT: flat_store_b32 v[0:1], v5 offset:24
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
245 ; GFX11-NEXT: s_endpgm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
246 bb:
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
247 %ld0 = load i32, ptr %lb
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
248 %la1 = getelementptr inbounds i32, ptr %lb, i32 2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
249 %ld1 = load i32, ptr %la1
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
250 %la2 = getelementptr inbounds i32, ptr %lb, i32 4
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
251 %ld2 = load i32, ptr %la2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
252 %la3 = getelementptr inbounds i32, ptr %lb, i32 6
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
253 %ld3 = load i32, ptr %la3
150
anatofuz
parents:
diff changeset
254
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
255 store i32 %ld0, ptr %sb
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
256 %sa1 = getelementptr inbounds i32, ptr %sb, i32 2
150
anatofuz
parents:
diff changeset
257 %add = add i32 %ld1, 1
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
258 store i32 %add, ptr %sa1
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
259 %sa2 = getelementptr inbounds i32, ptr %sb, i32 4
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
260 store i32 %ld2, ptr %sa2
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
261 %sa3 = getelementptr inbounds i32, ptr %sb, i32 6
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
262 store i32 %ld3, ptr %sa3
150
anatofuz
parents:
diff changeset
263
anatofuz
parents:
diff changeset
264 ret void
anatofuz
parents:
diff changeset
265 }
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
266
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
267 ; Cluster loads from the same texture with different coordinates
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
268 ; DBG-LABEL: cluster_image_load:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
269 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
270 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
271 ; DBG: {{^}}Cluster ld/st [[SU1:SU\([0-9]+\)]] - [[SU2:SU\([0-9]+\)]]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
272 ; DBG: {{^}}[[SU1]]: {{.*}} IMAGE_LOAD
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
273 ; DBG: {{^}}[[SU2]]: {{.*}} IMAGE_LOAD
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
274 define amdgpu_ps void @cluster_image_load(<8 x i32> inreg %src, <8 x i32> inreg %dst, i32 %x, i32 %y) {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
275 ; GFX9-LABEL: cluster_image_load:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
276 ; GFX9: ; %bb.0: ; %entry
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
277 ; GFX9-NEXT: v_add_u32_e32 v2, 1, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
278 ; GFX9-NEXT: v_add_u32_e32 v3, 1, v1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
279 ; GFX9-NEXT: v_add_u32_e32 v6, 2, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
280 ; GFX9-NEXT: v_add_u32_e32 v7, 2, v1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
281 ; GFX9-NEXT: image_load v[2:5], v[2:3], s[0:7] dmask:0xf unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
282 ; GFX9-NEXT: image_load v[6:9], v[6:7], s[0:7] dmask:0xf unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
283 ; GFX9-NEXT: s_waitcnt vmcnt(0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
284 ; GFX9-NEXT: v_add_f32_e32 v5, v5, v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
285 ; GFX9-NEXT: v_add_f32_e32 v4, v4, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
286 ; GFX9-NEXT: v_add_f32_e32 v3, v3, v7
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
287 ; GFX9-NEXT: v_add_f32_e32 v2, v2, v6
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
288 ; GFX9-NEXT: image_store v[2:5], v[0:1], s[8:15] dmask:0xf unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
289 ; GFX9-NEXT: s_endpgm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
290 ;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
291 ; GFX10-LABEL: cluster_image_load:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
292 ; GFX10: ; %bb.0: ; %entry
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
293 ; GFX10-NEXT: v_add_nc_u32_e32 v10, 1, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
294 ; GFX10-NEXT: v_add_nc_u32_e32 v11, 1, v1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
295 ; GFX10-NEXT: v_add_nc_u32_e32 v12, 2, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
296 ; GFX10-NEXT: v_add_nc_u32_e32 v13, 2, v1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
297 ; GFX10-NEXT: s_clause 0x1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
298 ; GFX10-NEXT: image_load v[2:5], v[10:11], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
299 ; GFX10-NEXT: image_load v[6:9], v[12:13], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
300 ; GFX10-NEXT: s_waitcnt vmcnt(0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
301 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
302 ; GFX10-NEXT: v_add_f32_e32 v4, v4, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
303 ; GFX10-NEXT: v_add_f32_e32 v3, v3, v7
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
304 ; GFX10-NEXT: v_add_f32_e32 v2, v2, v6
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
305 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
306 ; GFX10-NEXT: s_endpgm
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
307 ;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
308 ; GFX11-LABEL: cluster_image_load:
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
309 ; GFX11: ; %bb.0: ; %entry
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
310 ; GFX11-NEXT: v_add_nc_u32_e32 v2, 1, v0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
311 ; GFX11-NEXT: v_add_nc_u32_e32 v3, 1, v1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
312 ; GFX11-NEXT: v_add_nc_u32_e32 v6, 2, v0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
313 ; GFX11-NEXT: v_add_nc_u32_e32 v7, 2, v1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
314 ; GFX11-NEXT: s_clause 0x1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
315 ; GFX11-NEXT: image_load v[2:5], v[2:3], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
316 ; GFX11-NEXT: image_load v[6:9], v[6:7], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
317 ; GFX11-NEXT: s_waitcnt vmcnt(0)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
318 ; GFX11-NEXT: v_dual_add_f32 v2, v2, v6 :: v_dual_add_f32 v5, v5, v9
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
319 ; GFX11-NEXT: v_dual_add_f32 v4, v4, v8 :: v_dual_add_f32 v3, v3, v7
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
320 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
321 ; GFX11-NEXT: s_nop 0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
322 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
323 ; GFX11-NEXT: s_endpgm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
324 entry:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
325 %x1 = add i32 %x, 1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
326 %y1 = add i32 %y, 1
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
327 %val1 = call <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i32(i32 15, i32 %x1, i32 %y1, <8 x i32> %src, i32 0, i32 0)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
328 %x2 = add i32 %x, 2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
329 %y2 = add i32 %y, 2
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
330 %val2 = call <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i32(i32 15, i32 %x2, i32 %y2, <8 x i32> %src, i32 0, i32 0)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
331 %val = fadd fast <4 x float> %val1, %val2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
332 call void @llvm.amdgcn.image.store.2d.v4f32.i32(<4 x float> %val, i32 15, i32 %x, i32 %y, <8 x i32> %dst, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
333 ret void
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
334 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
335
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
336 ; Don't cluster loads from different textures
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
337 ; DBG-LABEL: no_cluster_image_load:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
338 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
339 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
340 ; DBG-NOT: {{^}}Cluster ld/st
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
341 define amdgpu_ps void @no_cluster_image_load(<8 x i32> inreg %src1, <8 x i32> inreg %src2, <8 x i32> inreg %dst, i32 %x, i32 %y) {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
342 ; GFX9-LABEL: no_cluster_image_load:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
343 ; GFX9: ; %bb.0: ; %entry
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
344 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
345 ; GFX9-NEXT: image_load_mip v[3:6], v[0:2], s[0:7] dmask:0xf unorm
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
346 ; GFX9-NEXT: image_load_mip v[7:10], v[0:2], s[8:15] dmask:0xf unorm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
347 ; GFX9-NEXT: s_waitcnt vmcnt(0)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
348 ; GFX9-NEXT: v_add_f32_e32 v6, v6, v10
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
349 ; GFX9-NEXT: v_add_f32_e32 v5, v5, v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
350 ; GFX9-NEXT: v_add_f32_e32 v4, v4, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
351 ; GFX9-NEXT: v_add_f32_e32 v3, v3, v7
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
352 ; GFX9-NEXT: image_store v[3:6], v[0:1], s[16:23] dmask:0xf unorm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
353 ; GFX9-NEXT: s_endpgm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
354 ;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
355 ; GFX10-LABEL: no_cluster_image_load:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
356 ; GFX10: ; %bb.0: ; %entry
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
357 ; GFX10-NEXT: v_mov_b32_e32 v10, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
358 ; GFX10-NEXT: image_load_mip v[2:5], [v0, v1, v10], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
359 ; GFX10-NEXT: image_load_mip v[6:9], [v0, v1, v10], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
360 ; GFX10-NEXT: s_waitcnt vmcnt(0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
361 ; GFX10-NEXT: v_add_f32_e32 v5, v5, v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
362 ; GFX10-NEXT: v_add_f32_e32 v4, v4, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
363 ; GFX10-NEXT: v_add_f32_e32 v3, v3, v7
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
364 ; GFX10-NEXT: v_add_f32_e32 v2, v2, v6
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
365 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[16:23] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
366 ; GFX10-NEXT: s_endpgm
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
367 ;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
368 ; GFX11-LABEL: no_cluster_image_load:
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
369 ; GFX11: ; %bb.0: ; %entry
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
370 ; GFX11-NEXT: v_mov_b32_e32 v6, 0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
371 ; GFX11-NEXT: image_load_mip v[2:5], [v0, v1, v6], s[0:7] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
372 ; GFX11-NEXT: image_load_mip v[6:9], [v0, v1, v6], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
373 ; GFX11-NEXT: s_waitcnt vmcnt(0)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
374 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v9 :: v_dual_add_f32 v4, v4, v8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
375 ; GFX11-NEXT: v_dual_add_f32 v3, v3, v7 :: v_dual_add_f32 v2, v2, v6
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
376 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[16:23] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
377 ; GFX11-NEXT: s_nop 0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
378 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
379 ; GFX11-NEXT: s_endpgm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
380 entry:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
381 %val1 = call <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i32(i32 15, i32 %x, i32 %y, i32 0, <8 x i32> %src1, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
382 %val2 = call <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i32(i32 15, i32 %x, i32 %y, i32 0, <8 x i32> %src2, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
383 %val = fadd fast <4 x float> %val1, %val2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
384 call void @llvm.amdgcn.image.store.2d.v4f32.i32(<4 x float> %val, i32 15, i32 %x, i32 %y, <8 x i32> %dst, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
385 ret void
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
386 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
387
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
388 ; Cluster loads from the same texture and sampler with different coordinates
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
389 ; DBG-LABEL: cluster_image_sample:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
390 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
391 ; DBG: Num BaseOps: {{[1-9]+}}, Offset: {{[0-9]+}}, OffsetIsScalable: {{[01]}}, Width: 16
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
392 ; DBG: {{^}}Cluster ld/st [[SU1:SU\([0-9]+\)]] - [[SU2:SU\([0-9]+\)]]
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
393 ; DBG: {{^}}[[SU1]]: {{.*}} IMAGE_SAMPLE
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
394 ; DBG: {{^}}[[SU2]]: {{.*}} IMAGE_SAMPLE
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
395 define amdgpu_ps void @cluster_image_sample(<8 x i32> inreg %src, <4 x i32> inreg %smp, <8 x i32> inreg %dst, i32 %x, i32 %y) {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
396 ; GFX9-LABEL: cluster_image_sample:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
397 ; GFX9: ; %bb.0: ; %entry
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
398 ; GFX9-NEXT: v_cvt_f32_i32_e32 v8, v0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
399 ; GFX9-NEXT: v_cvt_f32_i32_e32 v9, v1
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
400 ; GFX9-NEXT: v_mov_b32_e32 v4, 0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
401 ; GFX9-NEXT: v_mov_b32_e32 v5, v4
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
402 ; GFX9-NEXT: v_add_f32_e32 v2, 1.0, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
403 ; GFX9-NEXT: v_add_f32_e32 v3, 1.0, v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
404 ; GFX9-NEXT: v_mov_b32_e32 v6, v4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
405 ; GFX9-NEXT: v_mov_b32_e32 v7, v4
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
406 ; GFX9-NEXT: v_add_f32_e32 v8, 2.0, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
407 ; GFX9-NEXT: v_add_f32_e32 v9, 2.0, v9
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
408 ; GFX9-NEXT: v_mov_b32_e32 v10, 1.0
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
409 ; GFX9-NEXT: v_mov_b32_e32 v11, v10
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
410 ; GFX9-NEXT: v_mov_b32_e32 v12, v10
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
411 ; GFX9-NEXT: v_mov_b32_e32 v13, v10
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
412 ; GFX9-NEXT: image_sample_d v[2:5], v[2:7], s[0:7], s[8:11] dmask:0xf
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
413 ; GFX9-NEXT: image_sample_d v[6:9], v[8:13], s[0:7], s[8:11] dmask:0xf
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
414 ; GFX9-NEXT: s_waitcnt vmcnt(0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
415 ; GFX9-NEXT: v_add_f32_e32 v5, v5, v9
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
416 ; GFX9-NEXT: v_add_f32_e32 v4, v4, v8
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
417 ; GFX9-NEXT: v_add_f32_e32 v3, v3, v7
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
418 ; GFX9-NEXT: v_add_f32_e32 v2, v2, v6
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
419 ; GFX9-NEXT: image_store v[2:5], v[0:1], s[12:19] dmask:0xf unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
420 ; GFX9-NEXT: s_endpgm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
421 ;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
422 ; GFX10-LABEL: cluster_image_sample:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
423 ; GFX10: ; %bb.0: ; %entry
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
424 ; GFX10-NEXT: v_cvt_f32_i32_e32 v8, v0
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
425 ; GFX10-NEXT: v_cvt_f32_i32_e32 v9, v1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
426 ; GFX10-NEXT: v_mov_b32_e32 v4, 0
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
427 ; GFX10-NEXT: v_mov_b32_e32 v10, 1.0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
428 ; GFX10-NEXT: v_add_f32_e32 v2, 1.0, v8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
429 ; GFX10-NEXT: v_add_f32_e32 v3, 1.0, v9
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
430 ; GFX10-NEXT: v_mov_b32_e32 v5, v4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
431 ; GFX10-NEXT: v_mov_b32_e32 v6, v4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
432 ; GFX10-NEXT: v_mov_b32_e32 v7, v4
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
433 ; GFX10-NEXT: v_add_f32_e32 v8, 2.0, v8
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
434 ; GFX10-NEXT: v_add_f32_e32 v9, 2.0, v9
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
435 ; GFX10-NEXT: v_mov_b32_e32 v11, v10
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
436 ; GFX10-NEXT: v_mov_b32_e32 v12, v10
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
437 ; GFX10-NEXT: v_mov_b32_e32 v13, v10
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
438 ; GFX10-NEXT: s_clause 0x1
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
439 ; GFX10-NEXT: image_sample_d v[14:17], v[2:7], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
440 ; GFX10-NEXT: image_sample_d v[18:21], v[8:13], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
441 ; GFX10-NEXT: s_waitcnt vmcnt(0)
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
442 ; GFX10-NEXT: v_add_f32_e32 v5, v17, v21
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
443 ; GFX10-NEXT: v_add_f32_e32 v4, v16, v20
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
444 ; GFX10-NEXT: v_add_f32_e32 v3, v15, v19
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
445 ; GFX10-NEXT: v_add_f32_e32 v2, v14, v18
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
446 ; GFX10-NEXT: image_store v[2:5], v[0:1], s[12:19] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
447 ; GFX10-NEXT: s_endpgm
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
448 ;
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
449 ; GFX11-LABEL: cluster_image_sample:
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
450 ; GFX11: ; %bb.0: ; %entry
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
451 ; GFX11-NEXT: v_cvt_f32_i32_e32 v4, v0
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
452 ; GFX11-NEXT: v_cvt_f32_i32_e32 v5, v1
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
453 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
454 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
455 ; GFX11-NEXT: v_dual_mov_b32 v6, 1.0 :: v_dual_add_f32 v11, 2.0, v5
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
456 ; GFX11-NEXT: v_dual_add_f32 v9, 1.0, v5 :: v_dual_add_f32 v8, 1.0, v4
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
457 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
458 ; GFX11-NEXT: v_dual_mov_b32 v3, v2 :: v_dual_add_f32 v10, 2.0, v4
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
459 ; GFX11-NEXT: v_mov_b32_e32 v7, v6
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
460 ; GFX11-NEXT: s_clause 0x1
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
461 ; GFX11-NEXT: image_sample_d v[2:5], [v8, v9, v2, v2, v[2:3]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
462 ; GFX11-NEXT: image_sample_d v[6:9], [v10, v11, v6, v6, v[6:7]], s[0:7], s[8:11] dmask:0xf dim:SQ_RSRC_IMG_2D
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
463 ; GFX11-NEXT: s_waitcnt vmcnt(0)
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
464 ; GFX11-NEXT: v_dual_add_f32 v5, v5, v9 :: v_dual_add_f32 v4, v4, v8
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
465 ; GFX11-NEXT: v_dual_add_f32 v3, v3, v7 :: v_dual_add_f32 v2, v2, v6
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
466 ; GFX11-NEXT: image_store v[2:5], v[0:1], s[12:19] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
467 ; GFX11-NEXT: s_nop 0
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
468 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
469 ; GFX11-NEXT: s_endpgm
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
470 entry:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
471 %s = sitofp i32 %x to float
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
472 %t = sitofp i32 %y to float
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
473 %s1 = fadd float %s, 1.0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
474 %t1 = fadd float %t, 1.0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
475 %val1 = call <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32(i32 15, float %s1, float %t1, float 0.0, float 0.0, float 0.0, float 0.0, <8 x i32> %src, <4 x i32> %smp, i1 false, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
476 %s2 = fadd float %s, 2.0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
477 %t2 = fadd float %t, 2.0
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
478 %val2 = call <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32(i32 15, float %s2, float %t2, float 1.0, float 1.0, float 1.0, float 1.0, <8 x i32> %src, <4 x i32> %smp, i1 false, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
479 %val = fadd fast <4 x float> %val1, %val2
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
480 call void @llvm.amdgcn.image.store.2d.v4f32.i32(<4 x float> %val, i32 15, i32 %x, i32 %y, <8 x i32> %dst, i32 0, i32 0)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
481 ret void
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
482 }
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
483
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
484 declare <4 x float> @llvm.amdgcn.image.load.2d.v4f32.i32(i32 immarg, i32, i32, <8 x i32>, i32 immarg, i32 immarg)
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
485 declare <4 x float> @llvm.amdgcn.image.load.mip.2d.v4f32.i32(i32 immarg, i32, i32, i32, <8 x i32>, i32 immarg, i32 immarg)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
486 declare <4 x float> @llvm.amdgcn.image.sample.d.2d.v4f32.f32(i32, float, float, float, float, float, float, <8 x i32>, <4 x i32>, i1, i32, i32)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
487 declare void @llvm.amdgcn.image.store.2d.v4f32.i32(<4 x float>, i32 immarg, i32, i32, <8 x i32>, i32 immarg, i32 immarg)