1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -O0 -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck %s
5 name: test_inttoptr_s64_to_p0
10 ; CHECK-LABEL: name: test_inttoptr_s64_to_p0
11 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
12 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s64)
13 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0)
14 %0:_(s64) = COPY $vgpr0_vgpr1
15 %1:_(p0) = G_INTTOPTR %0
16 $vgpr0_vgpr1 = COPY %1
20 name: test_inttoptr_s64_to_p1
25 ; CHECK-LABEL: name: test_inttoptr_s64_to_p1
26 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
27 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p1) = G_INTTOPTR [[COPY]](s64)
28 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p1)
29 %0:_(s64) = COPY $vgpr0_vgpr1
30 %1:_(p1) = G_INTTOPTR %0
31 $vgpr0_vgpr1 = COPY %1
35 name: test_inttoptr_s64_to_p4
40 ; CHECK-LABEL: name: test_inttoptr_s64_to_p4
41 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
42 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p4) = G_INTTOPTR [[COPY]](s64)
43 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p4)
44 %0:_(s64) = COPY $vgpr0_vgpr1
45 %1:_(p4) = G_INTTOPTR %0
46 $vgpr0_vgpr1 = COPY %1
50 name: test_inttoptr_s32_to_p3
55 ; CHECK-LABEL: name: test_inttoptr_s32_to_p3
56 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
57 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[COPY]](s32)
58 ; CHECK: $vgpr0 = COPY [[INTTOPTR]](p3)
59 %0:_(s32) = COPY $vgpr0
60 %1:_(p3) = G_INTTOPTR %0
65 name: test_inttoptr_s32_to_p5
70 ; CHECK-LABEL: name: test_inttoptr_s32_to_p5
71 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
72 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p5) = G_INTTOPTR [[COPY]](s32)
73 ; CHECK: $vgpr0 = COPY [[INTTOPTR]](p5)
74 %0:_(s32) = COPY $vgpr0
75 %1:_(p5) = G_INTTOPTR %0
80 name: test_inttoptr_s64_to_p999
85 ; CHECK-LABEL: name: test_inttoptr_s64_to_p999
86 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
87 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p999) = G_INTTOPTR [[COPY]](s64)
88 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p999)
89 %0:_(s64) = COPY $vgpr0_vgpr1
90 %1:_(p999) = G_INTTOPTR %0
91 $vgpr0_vgpr1 = COPY %1
95 name: test_inttoptr_s32_to_p0
100 ; CHECK-LABEL: name: test_inttoptr_s32_to_p0
101 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
102 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s32)
103 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT]](s64)
104 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0)
105 %0:_(s32) = COPY $vgpr0
106 %1:_(p0) = G_INTTOPTR %0
107 $vgpr0_vgpr1 = COPY %1
111 name: test_inttoptr_s128_to_p0
114 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
116 ; CHECK-LABEL: name: test_inttoptr_s128_to_p0
117 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
118 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128)
119 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[TRUNC]](s64)
120 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0)
121 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
122 %1:_(p0) = G_INTTOPTR %0
123 $vgpr0_vgpr1 = COPY %1
127 name: test_inttoptr_v2s64_to_v2p0
130 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
132 ; CHECK-LABEL: name: test_inttoptr_v2s64_to_v2p0
133 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
134 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
135 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[UV]](s64)
136 ; CHECK: [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[UV1]](s64)
137 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[INTTOPTR]](p0), [[INTTOPTR1]](p0)
138 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
139 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
140 %1:_(<2 x p0>) = G_INTTOPTR %0
141 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
145 name: test_inttoptr_v2s32_to_v2p0
148 liveins: $vgpr0_vgpr1
150 ; CHECK-LABEL: name: test_inttoptr_v2s32_to_v2p0
151 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
152 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
153 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32)
154 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT]](s64)
155 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32)
156 ; CHECK: [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT1]](s64)
157 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[INTTOPTR]](p0), [[INTTOPTR1]](p0)
158 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>)
159 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
160 %1:_(<2 x p0>) = G_INTTOPTR %0
161 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1