1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
6 tracksRegLiveness: true
11 ; CHECK-LABEL: name: sshlsat_1
12 ; CHECK: liveins: $vgpr0
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
15 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
16 ; CHECK-NEXT: [[SSHLSAT:%[0-9]+]]:_(s32) = G_SSHLSAT [[COPY]], [[C]](s32)
17 ; CHECK-NEXT: $vgpr0 = COPY [[SSHLSAT]](s32)
18 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $vgpr0
19 %0:_(s32) = COPY $vgpr0
20 %2:_(s32) = G_CONSTANT i32 2
21 %3:_(s32) = G_SSHLSAT %0, %2(s32)
22 %4:_(s32) = G_SSHLSAT %3, %2(s32)
24 SI_RETURN_TO_EPILOG implicit $vgpr0
29 tracksRegLiveness: true
34 ; CHECK-LABEL: name: sshlsat_2
35 ; CHECK: liveins: $sgpr0
37 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
38 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
39 ; CHECK-NEXT: [[SSHLSAT:%[0-9]+]]:_(s32) = G_SSHLSAT [[COPY]], [[C]](s32)
40 ; CHECK-NEXT: [[INT:%[0-9]+]]:_(s32) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.readfirstlane), [[SSHLSAT]](s32)
41 ; CHECK-NEXT: $sgpr0 = COPY [[INT]](s32)
42 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $sgpr0
43 %0:_(s32) = COPY $sgpr0
44 %2:_(s32) = G_CONSTANT i32 1
45 %4:_(s32) = G_CONSTANT i32 2
46 %6:_(s32) = G_CONSTANT i32 3
47 %8:_(s32) = G_CONSTANT i32 4
48 %3:_(s32) = G_SSHLSAT %0, %2(s32)
49 %5:_(s32) = G_SSHLSAT %3, %4(s32)
50 %7:_(s32) = G_SSHLSAT %5, %6(s32)
51 %9:_(s32) = G_SSHLSAT %7, %8(s32)
52 %10:_(s32) = G_INTRINSIC_CONVERGENT intrinsic(@llvm.amdgcn.readfirstlane), %9(s32)
53 $sgpr0 = COPY %10(s32)
54 SI_RETURN_TO_EPILOG implicit $sgpr0
59 tracksRegLiveness: true
64 ; CHECK-LABEL: name: sshlsat_i32
65 ; CHECK: liveins: $vgpr0
67 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
68 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
69 ; CHECK-NEXT: [[SSHLSAT:%[0-9]+]]:_(s32) = G_SSHLSAT [[COPY]], [[C]](s32)
70 ; CHECK-NEXT: $vgpr0 = COPY [[SSHLSAT]](s32)
71 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $vgpr0
72 %0:_(s32) = COPY $vgpr0
73 %2:_(s32) = G_CONSTANT i32 10
74 %3:_(s32) = G_SSHLSAT %0, %2(s32)
75 %4:_(s32) = G_SSHLSAT %3, %2(s32)
76 %5:_(s32) = G_SSHLSAT %4, %2(s32)
77 %6:_(s32) = G_SSHLSAT %5, %2(s32)
79 SI_RETURN_TO_EPILOG implicit $vgpr0
84 tracksRegLiveness: true
87 liveins: $sgpr0, $sgpr1
89 ; CHECK-LABEL: name: sshlsat_i64
90 ; CHECK: liveins: $sgpr0, $sgpr1
92 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
93 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
94 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
95 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 62
96 ; CHECK-NEXT: [[SSHLSAT:%[0-9]+]]:_(s64) = G_SSHLSAT [[MV]], [[C]](s64)
97 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[SSHLSAT]](s64)
98 ; CHECK-NEXT: $sgpr0 = COPY [[UV]](s32)
99 ; CHECK-NEXT: $sgpr1 = COPY [[UV1]](s32)
100 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
101 %1:_(s32) = COPY $sgpr0
102 %2:_(s32) = COPY $sgpr1
103 %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32)
104 %4:_(s64) = G_CONSTANT i64 10
105 %11:_(s64) = G_CONSTANT i64 2
106 %5:_(s64) = G_SSHLSAT %0, %4(s64)
107 %6:_(s64) = G_SSHLSAT %5, %4(s64)
108 %7:_(s64) = G_SSHLSAT %6, %4(s64)
109 %8:_(s64) = G_SSHLSAT %7, %4(s64)
110 %9:_(s64) = G_SSHLSAT %8, %4(s64)
111 %10:_(s64) = G_SSHLSAT %9, %4(s64)
112 %12:_(s64) = G_SSHLSAT %10, %11(s64)
113 %13:_(s32), %14:_(s32) = G_UNMERGE_VALUES %12(s64)
114 $sgpr0 = COPY %13(s32)
115 $sgpr1 = COPY %14(s32)
116 SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
121 tracksRegLiveness: true
126 ; CHECK-LABEL: name: ushlsat_1
127 ; CHECK: liveins: $vgpr0
129 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
130 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
131 ; CHECK-NEXT: [[USHLSAT:%[0-9]+]]:_(s32) = G_USHLSAT [[COPY]], [[C]](s32)
132 ; CHECK-NEXT: $vgpr0 = COPY [[USHLSAT]](s32)
133 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $vgpr0
134 %0:_(s32) = COPY $vgpr0
135 %2:_(s32) = G_CONSTANT i32 2
136 %3:_(s32) = G_USHLSAT %0, %2(s32)
137 %4:_(s32) = G_USHLSAT %3, %2(s32)
138 $vgpr0 = COPY %4(s32)
139 SI_RETURN_TO_EPILOG implicit $vgpr0
144 tracksRegLiveness: true
149 ; CHECK-LABEL: name: ushlsat_2
150 ; CHECK: liveins: $sgpr0
152 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
153 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
154 ; CHECK-NEXT: [[USHLSAT:%[0-9]+]]:_(s32) = G_USHLSAT [[COPY]], [[C]](s32)
155 ; CHECK-NEXT: $sgpr0 = COPY [[USHLSAT]](s32)
156 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $sgpr0
157 %0:_(s32) = COPY $sgpr0
158 %2:_(s32) = G_CONSTANT i32 1
159 %4:_(s32) = G_CONSTANT i32 2
160 %6:_(s32) = G_CONSTANT i32 3
161 %8:_(s32) = G_CONSTANT i32 4
162 %3:_(s32) = G_USHLSAT %0, %2(s32)
163 %5:_(s32) = G_USHLSAT %3, %4(s32)
164 %7:_(s32) = G_USHLSAT %5, %6(s32)
165 %9:_(s32) = G_USHLSAT %7, %8(s32)
166 $sgpr0 = COPY %9(s32)
167 SI_RETURN_TO_EPILOG implicit $sgpr0
172 tracksRegLiveness: true
177 ; CHECK-LABEL: name: ushlsat_i32
178 ; CHECK: liveins: $vgpr0
180 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
181 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
182 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 30
183 ; CHECK-NEXT: [[USHLSAT:%[0-9]+]]:_(s32) = G_USHLSAT [[COPY]], [[C1]](s32)
184 ; CHECK-NEXT: [[USHLSAT1:%[0-9]+]]:_(s32) = G_USHLSAT [[USHLSAT]], [[C]](s32)
185 ; CHECK-NEXT: $vgpr0 = COPY [[USHLSAT1]](s32)
186 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $vgpr0
187 %0:_(s32) = COPY $vgpr0
188 %2:_(s32) = G_CONSTANT i32 10
189 %3:_(s32) = G_USHLSAT %0, %2(s32)
190 %4:_(s32) = G_USHLSAT %3, %2(s32)
191 %5:_(s32) = G_USHLSAT %4, %2(s32)
192 %6:_(s32) = G_USHLSAT %5, %2(s32)
193 $vgpr0 = COPY %6(s32)
194 SI_RETURN_TO_EPILOG implicit $vgpr0
199 tracksRegLiveness: true
202 liveins: $sgpr0, $sgpr1
204 ; CHECK-LABEL: name: ushlsat_i64
205 ; CHECK: liveins: $sgpr0, $sgpr1
207 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
208 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
209 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
210 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 10
211 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 60
212 ; CHECK-NEXT: [[USHLSAT:%[0-9]+]]:_(s64) = G_USHLSAT [[MV]], [[C1]](s64)
213 ; CHECK-NEXT: [[USHLSAT1:%[0-9]+]]:_(s64) = G_USHLSAT [[USHLSAT]], [[C]](s64)
214 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[USHLSAT1]](s64)
215 ; CHECK-NEXT: $sgpr0 = COPY [[UV]](s32)
216 ; CHECK-NEXT: $sgpr1 = COPY [[UV1]](s32)
217 ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
218 %1:_(s32) = COPY $sgpr0
219 %2:_(s32) = COPY $sgpr1
220 %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32)
221 %4:_(s64) = G_CONSTANT i64 10
222 %5:_(s64) = G_USHLSAT %0, %4(s64)
223 %6:_(s64) = G_USHLSAT %5, %4(s64)
224 %7:_(s64) = G_USHLSAT %6, %4(s64)
225 %8:_(s64) = G_USHLSAT %7, %4(s64)
226 %9:_(s64) = G_USHLSAT %8, %4(s64)
227 %10:_(s64) = G_USHLSAT %9, %4(s64)
228 %11:_(s64) = G_USHLSAT %10, %4(s64)
229 %12:_(s32), %13:_(s32) = G_UNMERGE_VALUES %11(s64)
230 $sgpr0 = COPY %12(s32)
231 $sgpr1 = COPY %13(s32)
232 SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1