1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -O0 -run-pass=legalizer -o - %s | FileCheck %s
5 name: test_inttoptr_s64_to_p0
10 ; CHECK-LABEL: name: test_inttoptr_s64_to_p0
11 ; CHECK: liveins: $vgpr0_vgpr1
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
14 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s64)
15 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0)
16 %0:_(s64) = COPY $vgpr0_vgpr1
17 %1:_(p0) = G_INTTOPTR %0
18 $vgpr0_vgpr1 = COPY %1
22 name: test_inttoptr_s64_to_p1
27 ; CHECK-LABEL: name: test_inttoptr_s64_to_p1
28 ; CHECK: liveins: $vgpr0_vgpr1
30 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
31 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p1) = G_INTTOPTR [[COPY]](s64)
32 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p1)
33 %0:_(s64) = COPY $vgpr0_vgpr1
34 %1:_(p1) = G_INTTOPTR %0
35 $vgpr0_vgpr1 = COPY %1
39 name: test_inttoptr_s64_to_p4
44 ; CHECK-LABEL: name: test_inttoptr_s64_to_p4
45 ; CHECK: liveins: $vgpr0_vgpr1
47 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
48 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p4) = G_INTTOPTR [[COPY]](s64)
49 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p4)
50 %0:_(s64) = COPY $vgpr0_vgpr1
51 %1:_(p4) = G_INTTOPTR %0
52 $vgpr0_vgpr1 = COPY %1
56 name: test_inttoptr_s32_to_p3
61 ; CHECK-LABEL: name: test_inttoptr_s32_to_p3
62 ; CHECK: liveins: $vgpr0
64 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
65 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[COPY]](s32)
66 ; CHECK-NEXT: $vgpr0 = COPY [[INTTOPTR]](p3)
67 %0:_(s32) = COPY $vgpr0
68 %1:_(p3) = G_INTTOPTR %0
73 name: test_inttoptr_s32_to_p5
78 ; CHECK-LABEL: name: test_inttoptr_s32_to_p5
79 ; CHECK: liveins: $vgpr0
81 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
82 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p5) = G_INTTOPTR [[COPY]](s32)
83 ; CHECK-NEXT: $vgpr0 = COPY [[INTTOPTR]](p5)
84 %0:_(s32) = COPY $vgpr0
85 %1:_(p5) = G_INTTOPTR %0
90 name: test_inttoptr_s64_to_p999
95 ; CHECK-LABEL: name: test_inttoptr_s64_to_p999
96 ; CHECK: liveins: $vgpr0_vgpr1
98 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
99 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p999) = G_INTTOPTR [[COPY]](s64)
100 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p999)
101 %0:_(s64) = COPY $vgpr0_vgpr1
102 %1:_(p999) = G_INTTOPTR %0
103 $vgpr0_vgpr1 = COPY %1
107 name: test_inttoptr_s32_to_p0
112 ; CHECK-LABEL: name: test_inttoptr_s32_to_p0
113 ; CHECK: liveins: $vgpr0
115 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
116 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s32)
117 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT]](s64)
118 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0)
119 %0:_(s32) = COPY $vgpr0
120 %1:_(p0) = G_INTTOPTR %0
121 $vgpr0_vgpr1 = COPY %1
125 name: test_inttoptr_s128_to_p0
128 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
130 ; CHECK-LABEL: name: test_inttoptr_s128_to_p0
131 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
133 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
134 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128)
135 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[TRUNC]](s64)
136 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0)
137 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
138 %1:_(p0) = G_INTTOPTR %0
139 $vgpr0_vgpr1 = COPY %1
143 name: test_inttoptr_v2s64_to_v2p0
146 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
148 ; CHECK-LABEL: name: test_inttoptr_v2s64_to_v2p0
149 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
151 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
152 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
153 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[UV]](s64)
154 ; CHECK-NEXT: [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[UV1]](s64)
155 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[INTTOPTR]](p0), [[INTTOPTR1]](p0)
156 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
157 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
158 %1:_(<2 x p0>) = G_INTTOPTR %0
159 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
163 name: test_inttoptr_v2s32_to_v2p0
166 liveins: $vgpr0_vgpr1
168 ; CHECK-LABEL: name: test_inttoptr_v2s32_to_v2p0
169 ; CHECK: liveins: $vgpr0_vgpr1
171 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
172 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
173 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32)
174 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT]](s64)
175 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32)
176 ; CHECK-NEXT: [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT1]](s64)
177 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[INTTOPTR]](p0), [[INTTOPTR1]](p0)
178 ; CHECK-NEXT: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
179 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
180 %1:_(<2 x p0>) = G_INTTOPTR %0
181 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
185 name: test_inttoptr_s29_to_p3
190 ; CHECK-LABEL: name: test_inttoptr_s29_to_p3
191 ; CHECK: liveins: $vgpr0
193 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
194 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 536870911
195 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
196 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[AND]](s32)
197 ; CHECK-NEXT: S_ENDPGM 0, implicit [[INTTOPTR]](p3)
198 %0:_(s32) = COPY $vgpr0
199 %1:_(s29) = G_TRUNC %0
200 %2:_(p3) = G_INTTOPTR %1
201 S_ENDPGM 0, implicit %2
205 name: test_inttoptr_s33_to_p3
208 liveins: $vgpr0_vgpr1
210 ; CHECK-LABEL: name: test_inttoptr_s33_to_p3
211 ; CHECK: liveins: $vgpr0_vgpr1
213 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
214 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
215 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[TRUNC]](s32)
216 ; CHECK-NEXT: S_ENDPGM 0, implicit [[INTTOPTR]](p3)
217 %0:_(s64) = COPY $vgpr0_vgpr1
218 %1:_(s33) = G_TRUNC %0
219 %2:_(p3) = G_INTTOPTR %1
220 S_ENDPGM 0, implicit %2