1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck --check-prefix=CHECK-SDAG -enable-var-scope %s
4 define void @test_readlane_p0(ptr addrspace(1) %out, ptr %src, i32 %src1) {
5 ; CHECK-SDAG-LABEL: test_readlane_p0:
7 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
8 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v4
9 ; CHECK-SDAG-NEXT: s_nop 3
10 ; CHECK-SDAG-NEXT: v_readlane_b32 s5, v3, s4
11 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
12 ; CHECK-SDAG-NEXT: ;;#ASMSTART
13 ; CHECK-SDAG-NEXT: ; use s[4:5]
14 ; CHECK-SDAG-NEXT: ;;#ASMEND
15 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
16 %x = call ptr @llvm.amdgcn.readlane.p0(ptr %src, i32 %src1)
17 call void asm sideeffect "; use $0", "s"(ptr %x)
21 define void @test_readlane_v3p0(ptr addrspace(1) %out, <3 x ptr> %src, i32 %src1) {
22 ; CHECK-SDAG-LABEL: test_readlane_v3p0:
23 ; CHECK-SDAG: ; %bb.0:
24 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
25 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v8
26 ; CHECK-SDAG-NEXT: s_nop 3
27 ; CHECK-SDAG-NEXT: v_readlane_b32 s9, v7, s4
28 ; CHECK-SDAG-NEXT: v_readlane_b32 s8, v6, s4
29 ; CHECK-SDAG-NEXT: v_readlane_b32 s7, v5, s4
30 ; CHECK-SDAG-NEXT: v_readlane_b32 s6, v4, s4
31 ; CHECK-SDAG-NEXT: v_readlane_b32 s5, v3, s4
32 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
33 ; CHECK-SDAG-NEXT: ;;#ASMSTART
34 ; CHECK-SDAG-NEXT: ; use s[4:9]
35 ; CHECK-SDAG-NEXT: ;;#ASMEND
36 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
37 %x = call <3 x ptr> @llvm.amdgcn.readlane.v3p0(<3 x ptr> %src, i32 %src1)
38 call void asm sideeffect "; use $0", "s"(<3 x ptr> %x)
42 define void @test_readlane_p3(ptr addrspace(1) %out, ptr addrspace(3) %src, i32 %src1) {
43 ; CHECK-SDAG-LABEL: test_readlane_p3:
44 ; CHECK-SDAG: ; %bb.0:
45 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
46 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v3
47 ; CHECK-SDAG-NEXT: s_nop 3
48 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
49 ; CHECK-SDAG-NEXT: ;;#ASMSTART
50 ; CHECK-SDAG-NEXT: ; use s4
51 ; CHECK-SDAG-NEXT: ;;#ASMEND
52 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
53 %x = call ptr addrspace(3) @llvm.amdgcn.readlane.p3(ptr addrspace(3) %src, i32 %src1)
54 call void asm sideeffect "; use $0", "s"(ptr addrspace(3) %x)
58 define void @test_readlane_v3p3(ptr addrspace(1) %out, <3 x ptr addrspace(3)> %src, i32 %src1) {
59 ; CHECK-SDAG-LABEL: test_readlane_v3p3:
60 ; CHECK-SDAG: ; %bb.0:
61 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
62 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v5
63 ; CHECK-SDAG-NEXT: s_nop 3
64 ; CHECK-SDAG-NEXT: v_readlane_b32 s6, v4, s4
65 ; CHECK-SDAG-NEXT: v_readlane_b32 s5, v3, s4
66 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
67 ; CHECK-SDAG-NEXT: ;;#ASMSTART
68 ; CHECK-SDAG-NEXT: ; use s[4:6]
69 ; CHECK-SDAG-NEXT: ;;#ASMEND
70 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
71 %x = call <3 x ptr addrspace(3)> @llvm.amdgcn.readlane.v3p3(<3 x ptr addrspace(3)> %src, i32 %src1)
72 call void asm sideeffect "; use $0", "s"(<3 x ptr addrspace(3)> %x)
76 define void @test_readlane_p5(ptr addrspace(1) %out, ptr addrspace(5) %src, i32 %src1) {
77 ; CHECK-SDAG-LABEL: test_readlane_p5:
78 ; CHECK-SDAG: ; %bb.0:
79 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
80 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v3
81 ; CHECK-SDAG-NEXT: s_nop 3
82 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
83 ; CHECK-SDAG-NEXT: ;;#ASMSTART
84 ; CHECK-SDAG-NEXT: ; use s4
85 ; CHECK-SDAG-NEXT: ;;#ASMEND
86 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
87 %x = call ptr addrspace(5) @llvm.amdgcn.readlane.p5(ptr addrspace(5) %src, i32 %src1)
88 call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %x)
92 define void @test_readlane_v3p5(ptr addrspace(1) %out, <3 x ptr addrspace(5)> %src, i32 %src1) {
93 ; CHECK-SDAG-LABEL: test_readlane_v3p5:
94 ; CHECK-SDAG: ; %bb.0:
95 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
96 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v5
97 ; CHECK-SDAG-NEXT: s_nop 3
98 ; CHECK-SDAG-NEXT: v_readlane_b32 s6, v4, s4
99 ; CHECK-SDAG-NEXT: v_readlane_b32 s5, v3, s4
100 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
101 ; CHECK-SDAG-NEXT: ;;#ASMSTART
102 ; CHECK-SDAG-NEXT: ; use s[4:6]
103 ; CHECK-SDAG-NEXT: ;;#ASMEND
104 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
105 %x = call <3 x ptr addrspace(5)> @llvm.amdgcn.readlane.v3p5(<3 x ptr addrspace(5)> %src, i32 %src1)
106 call void asm sideeffect "; use $0", "s"(<3 x ptr addrspace(5)> %x)
110 define void @test_readlane_p6(ptr addrspace(1) %out, ptr addrspace(6) %src, i32 %src1) {
111 ; CHECK-SDAG-LABEL: test_readlane_p6:
112 ; CHECK-SDAG: ; %bb.0:
113 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
114 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v3
115 ; CHECK-SDAG-NEXT: s_nop 3
116 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
117 ; CHECK-SDAG-NEXT: ;;#ASMSTART
118 ; CHECK-SDAG-NEXT: ; use s4
119 ; CHECK-SDAG-NEXT: ;;#ASMEND
120 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
121 %x = call ptr addrspace(6) @llvm.amdgcn.readlane.p6(ptr addrspace(6) %src, i32 %src1)
122 call void asm sideeffect "; use $0", "s"(ptr addrspace(6) %x)
126 define void @test_readlane_v3p6(ptr addrspace(1) %out, <3 x ptr addrspace(6)> %src, i32 %src1) {
127 ; CHECK-SDAG-LABEL: test_readlane_v3p6:
128 ; CHECK-SDAG: ; %bb.0:
129 ; CHECK-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
130 ; CHECK-SDAG-NEXT: v_readfirstlane_b32 s4, v5
131 ; CHECK-SDAG-NEXT: s_nop 3
132 ; CHECK-SDAG-NEXT: v_readlane_b32 s6, v4, s4
133 ; CHECK-SDAG-NEXT: v_readlane_b32 s5, v3, s4
134 ; CHECK-SDAG-NEXT: v_readlane_b32 s4, v2, s4
135 ; CHECK-SDAG-NEXT: ;;#ASMSTART
136 ; CHECK-SDAG-NEXT: ; use s[4:6]
137 ; CHECK-SDAG-NEXT: ;;#ASMEND
138 ; CHECK-SDAG-NEXT: s_setpc_b64 s[30:31]
139 %x = call <3 x ptr addrspace(6)> @llvm.amdgcn.readlane.v3p6(<3 x ptr addrspace(6)> %src, i32 %src1)
140 call void asm sideeffect "; use $0", "s"(<3 x ptr addrspace(6)> %x)