1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck %s
8 liveins: $vgpr0_vgpr1, $vgpr2
10 ; CHECK-LABEL: name: ptrmask_p1_s16
11 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
14 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
15 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY1]](s32)
16 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
17 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C]]
18 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p1) = G_PTRMASK [[COPY]], [[AND]](s64)
19 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p1)
20 %0:_(p1) = COPY $vgpr0_vgpr1
21 %1:_(s32) = COPY $vgpr2
22 %2:_(s16) = G_TRUNC %1
23 %3:_(p1) = G_PTRMASK %0, %2
24 $vgpr0_vgpr1 = COPY %3
31 liveins: $vgpr0_vgpr1, $vgpr2
33 ; CHECK-LABEL: name: ptrmask_p1_s32
34 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
37 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
38 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
39 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p1) = G_PTRMASK [[COPY]], [[ZEXT]](s64)
40 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p1)
41 %0:_(p1) = COPY $vgpr0_vgpr1
42 %1:_(s32) = COPY $vgpr2
43 %2:_(p1) = G_PTRMASK %0, %1
44 $vgpr0_vgpr1 = COPY %2
51 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
53 ; CHECK-LABEL: name: ptrmask_p1_s64
54 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
56 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
57 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
58 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p1) = G_PTRMASK [[COPY]], [[COPY1]](s64)
59 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p1)
60 %0:_(p1) = COPY $vgpr0_vgpr1
61 %1:_(s64) = COPY $vgpr2_vgpr3
62 %2:_(p1) = G_PTRMASK %0, %1
63 $vgpr0_vgpr1 = COPY %2
70 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
72 ; CHECK-LABEL: name: ptrmask_p1_s96
73 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
75 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
76 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr2_vgpr3_vgpr4
77 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s96)
78 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p1) = G_PTRMASK [[COPY]], [[TRUNC]](s64)
79 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p1)
80 %0:_(p1) = COPY $vgpr0_vgpr1
81 %1:_(s96) = COPY $vgpr2_vgpr3_vgpr4
82 %2:_(p1) = G_PTRMASK %0, %1
83 $vgpr0_vgpr1 = COPY %2
90 liveins: $vgpr0_vgpr1, $vgpr2
92 ; CHECK-LABEL: name: ptrmask_p0_s16
93 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2
95 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
96 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
97 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY1]](s32)
98 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
99 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C]]
100 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[COPY]], [[AND]](s64)
101 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p0)
102 %0:_(p0) = COPY $vgpr0_vgpr1
103 %1:_(s32) = COPY $vgpr2
104 %2:_(s16) = G_TRUNC %1
105 %3:_(p0) = G_PTRMASK %0, %2
106 $vgpr0_vgpr1 = COPY %3
113 liveins: $vgpr0_vgpr1, $vgpr2
115 ; CHECK-LABEL: name: ptrmask_p0_s32
116 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2
118 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
119 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
120 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY1]](s32)
121 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[COPY]], [[ZEXT]](s64)
122 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p0)
123 %0:_(p0) = COPY $vgpr0_vgpr1
124 %1:_(s32) = COPY $vgpr2
125 %2:_(p0) = G_PTRMASK %0, %1
126 $vgpr0_vgpr1 = COPY %2
133 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
135 ; CHECK-LABEL: name: ptrmask_p0_s64
136 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
138 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
139 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
140 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[COPY]], [[COPY1]](s64)
141 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p0)
142 %0:_(p0) = COPY $vgpr0_vgpr1
143 %1:_(s64) = COPY $vgpr2_vgpr3
144 %2:_(p0) = G_PTRMASK %0, %1
145 $vgpr0_vgpr1 = COPY %2
152 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
154 ; CHECK-LABEL: name: ptrmask_p0_s96
155 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3_vgpr4
157 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
158 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr2_vgpr3_vgpr4
159 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s96)
160 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[COPY]], [[TRUNC]](s64)
161 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[PTRMASK]](p0)
162 %0:_(p0) = COPY $vgpr0_vgpr1
163 %1:_(s96) = COPY $vgpr2_vgpr3_vgpr4
164 %2:_(p0) = G_PTRMASK %0, %1
165 $vgpr0_vgpr1 = COPY %2
172 liveins: $vgpr0, $vgpr1
174 ; CHECK-LABEL: name: ptrmask_p3_s16
175 ; CHECK: liveins: $vgpr0, $vgpr1
177 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
178 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
179 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
180 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
181 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p3) = G_PTRMASK [[COPY]], [[AND]](s32)
182 ; CHECK-NEXT: $vgpr0 = COPY [[PTRMASK]](p3)
183 %0:_(p3) = COPY $vgpr0
184 %1:_(s32) = COPY $vgpr1
185 %2:_(s16) = G_TRUNC %1
186 %3:_(p3) = G_PTRMASK %0, %2
194 liveins: $vgpr0, $vgpr1
196 ; CHECK-LABEL: name: ptrmask_p3_s32
197 ; CHECK: liveins: $vgpr0, $vgpr1
199 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
200 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
201 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p3) = G_PTRMASK [[COPY]], [[COPY1]](s32)
202 ; CHECK-NEXT: $vgpr0 = COPY [[PTRMASK]](p3)
203 %0:_(p3) = COPY $vgpr0
204 %1:_(s32) = COPY $vgpr1
205 %2:_(p3) = G_PTRMASK %0, %1
213 liveins: $vgpr0, $vgpr1_vgpr2
215 ; CHECK-LABEL: name: ptrmask_p3_s64
216 ; CHECK: liveins: $vgpr0, $vgpr1_vgpr2
218 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
219 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr1_vgpr2
220 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
221 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p3) = G_PTRMASK [[COPY]], [[TRUNC]](s32)
222 ; CHECK-NEXT: $vgpr0 = COPY [[PTRMASK]](p3)
223 %0:_(p3) = COPY $vgpr0
224 %1:_(s64) = COPY $vgpr1_vgpr2
225 %2:_(p3) = G_PTRMASK %0, %1
233 liveins: $vgpr0, $vgpr1_vgpr2_vgpr3
235 ; CHECK-LABEL: name: ptrmask_p3_s96
236 ; CHECK: liveins: $vgpr0, $vgpr1_vgpr2_vgpr3
238 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
239 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr1_vgpr2_vgpr3
240 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s96)
241 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p3) = G_PTRMASK [[COPY]], [[TRUNC]](s32)
242 ; CHECK-NEXT: $vgpr0 = COPY [[PTRMASK]](p3)
243 %0:_(p3) = COPY $vgpr0
244 %1:_(s96) = COPY $vgpr1_vgpr2_vgpr3
245 %2:_(p3) = G_PTRMASK %0, %1