1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
5 name: add_ptrtoint_p1_to_s64_lhs
6 tracksRegLiveness: true
9 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
11 ; GCN-LABEL: name: add_ptrtoint_p1_to_s64_lhs
12 ; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
14 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
15 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
16 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
17 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[PTR_ADD]](p1)
18 ; GCN-NEXT: $vgpr0_vgpr1 = COPY [[PTRTOINT]](s64)
19 %0:_(p1) = COPY $vgpr0_vgpr1
20 %1:_(s64) = COPY $vgpr2_vgpr3
21 %2:_(s64) = G_PTRTOINT %0
22 %3:_(s64) = G_ADD %2, %1
23 $vgpr0_vgpr1 = COPY %3
28 name: add_ptrtoint_p1_to_s32_lhs
29 tracksRegLiveness: true
32 liveins: $vgpr0_vgpr1, $vgpr2
34 ; GCN-LABEL: name: add_ptrtoint_p1_to_s32_lhs
35 ; GCN: liveins: $vgpr0_vgpr1, $vgpr2
37 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
38 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
39 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p1)
40 ; GCN-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[PTRTOINT]], [[COPY1]]
41 ; GCN-NEXT: $vgpr0 = COPY [[ADD]](s32)
42 %0:_(p1) = COPY $vgpr0_vgpr1
43 %1:_(s32) = COPY $vgpr2
44 %2:_(s32) = G_PTRTOINT %0
45 %3:_(s32) = G_ADD %2, %1
51 name: add_ptrtoint_p3_to_s32_lhs
52 tracksRegLiveness: true
55 liveins: $vgpr0, $vgpr1
57 ; GCN-LABEL: name: add_ptrtoint_p3_to_s32_lhs
58 ; GCN: liveins: $vgpr0, $vgpr1
60 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
61 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
62 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:_(p3) = G_PTR_ADD [[COPY]], [[COPY1]](s32)
63 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[PTR_ADD]](p3)
64 ; GCN-NEXT: $vgpr0 = COPY [[PTRTOINT]](s32)
65 %0:_(p3) = COPY $vgpr0
66 %1:_(s32) = COPY $vgpr1
67 %2:_(s32) = G_PTRTOINT %0
68 %3:_(s32) = G_ADD %2, %1
74 name: inttoptr_add_ptrtoint_p1_to_s64_lhs
75 tracksRegLiveness: true
78 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
80 ; GCN-LABEL: name: inttoptr_add_ptrtoint_p1_to_s64_lhs
81 ; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
83 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
84 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
85 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
86 ; GCN-NEXT: $vgpr0_vgpr1 = COPY [[PTR_ADD]](p1)
87 %0:_(p1) = COPY $vgpr0_vgpr1
88 %1:_(s64) = COPY $vgpr2_vgpr3
89 %2:_(s64) = G_PTRTOINT %0
90 %3:_(s64) = G_ADD %2, %1
91 %4:_(p1) = G_INTTOPTR %3
92 $vgpr0_vgpr1 = COPY %4
97 name: add_ptrtoint_v2p3_to_v2s32_lhs
98 tracksRegLiveness: true
101 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
103 ; GCN-LABEL: name: add_ptrtoint_v2p3_to_v2s32_lhs
104 ; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
106 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(<2 x p3>) = COPY $vgpr0_vgpr1
107 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
108 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:_(<2 x p3>) = G_PTR_ADD [[COPY]], [[COPY1]](<2 x s32>)
109 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(<2 x s32>) = G_PTRTOINT [[PTR_ADD]](<2 x p3>)
110 ; GCN-NEXT: $vgpr0_vgpr1 = COPY [[PTRTOINT]](<2 x s32>)
111 %0:_(<2 x p3>) = COPY $vgpr0_vgpr1
112 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
113 %2:_(<2 x s32>) = G_PTRTOINT %0
114 %3:_(<2 x s32>) = G_ADD %2, %1
115 $vgpr0_vgpr1 = COPY %3
120 name: add_ptrtoint_v2p1_to_v2s32_lhs
121 tracksRegLiveness: true
124 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5
126 ; GCN-LABEL: name: add_ptrtoint_v2p1_to_v2s32_lhs
127 ; GCN: liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5
129 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
130 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
131 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(<2 x s32>) = G_PTRTOINT [[COPY]](<2 x p1>)
132 ; GCN-NEXT: [[ADD:%[0-9]+]]:_(<2 x s32>) = G_ADD [[PTRTOINT]], [[COPY1]]
133 ; GCN-NEXT: $vgpr0_vgpr1 = COPY [[ADD]](<2 x s32>)
134 %0:_(<2 x p1>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
135 %1:_(<2 x s32>) = COPY $vgpr4_vgpr5
136 %2:_(<2 x s32>) = G_PTRTOINT %0
137 %3:_(<2 x s32>) = G_ADD %2, %1
138 $vgpr0_vgpr1 = COPY %3
143 name: add_ptrtoint_p1_to_s64_rhs
144 tracksRegLiveness: true
147 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
149 ; GCN-LABEL: name: add_ptrtoint_p1_to_s64_rhs
150 ; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
152 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
153 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
154 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
155 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[PTR_ADD]](p1)
156 ; GCN-NEXT: $vgpr0_vgpr1 = COPY [[PTRTOINT]](s64)
157 %0:_(p1) = COPY $vgpr0_vgpr1
158 %1:_(s64) = COPY $vgpr2_vgpr3
159 %2:_(s64) = G_PTRTOINT %0
160 %3:_(s64) = G_ADD %1, %2
161 $vgpr0_vgpr1 = COPY %3
166 name: add_ptrtoint_p1_to_s64_lhs_rhs
167 tracksRegLiveness: true
170 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
172 ; GCN-LABEL: name: add_ptrtoint_p1_to_s64_lhs_rhs
173 ; GCN: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
175 ; GCN-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
176 ; GCN-NEXT: [[COPY1:%[0-9]+]]:_(p1) = COPY $vgpr2_vgpr3
177 ; GCN-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[COPY1]](p1)
178 ; GCN-NEXT: [[PTR_ADD:%[0-9]+]]:_(p1) = G_PTR_ADD [[COPY]], [[PTRTOINT]](s64)
179 ; GCN-NEXT: [[PTRTOINT1:%[0-9]+]]:_(s64) = G_PTRTOINT [[PTR_ADD]](p1)
180 ; GCN-NEXT: $vgpr0_vgpr1 = COPY [[PTRTOINT1]](s64)
181 %0:_(p1) = COPY $vgpr0_vgpr1
182 %1:_(p1) = COPY $vgpr2_vgpr3
183 %2:_(s64) = G_PTRTOINT %0
184 %3:_(s64) = G_PTRTOINT %1
185 %4:_(s64) = G_ADD %2, %3
186 $vgpr0_vgpr1 = COPY %4