• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
4---
5name:            sshlsat_1
6tracksRegLiveness: true
7body:             |
8  bb.0:
9    liveins: $vgpr0
10
11    ; CHECK-LABEL: name: sshlsat_1
12    ; CHECK: liveins: $vgpr0
13    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
15    ; CHECK: [[SSHLSAT:%[0-9]+]]:_(s32) = G_SSHLSAT [[COPY]], [[C]](s32)
16    ; CHECK: $vgpr0 = COPY [[SSHLSAT]](s32)
17    ; CHECK: SI_RETURN_TO_EPILOG implicit $vgpr0
18    %0:_(s32) = COPY $vgpr0
19    %2:_(s32) = G_CONSTANT i32 2
20    %3:_(s32) = G_SSHLSAT %0, %2(s32)
21    %4:_(s32) = G_SSHLSAT %3, %2(s32)
22    $vgpr0 = COPY %4(s32)
23    SI_RETURN_TO_EPILOG implicit $vgpr0
24
25...
26---
27name:            sshlsat_2
28tracksRegLiveness: true
29body:             |
30  bb.0:
31    liveins: $sgpr0
32
33    ; CHECK-LABEL: name: sshlsat_2
34    ; CHECK: liveins: $sgpr0
35    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
36    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
37    ; CHECK: [[SSHLSAT:%[0-9]+]]:_(s32) = G_SSHLSAT [[COPY]], [[C]](s32)
38    ; CHECK: [[INT:%[0-9]+]]:_(s32) = G_INTRINSIC intrinsic(@llvm.amdgcn.readfirstlane), [[SSHLSAT]](s32)
39    ; CHECK: $sgpr0 = COPY [[INT]](s32)
40    ; CHECK: SI_RETURN_TO_EPILOG implicit $sgpr0
41    %0:_(s32) = COPY $sgpr0
42    %2:_(s32) = G_CONSTANT i32 1
43    %4:_(s32) = G_CONSTANT i32 2
44    %6:_(s32) = G_CONSTANT i32 3
45    %8:_(s32) = G_CONSTANT i32 4
46    %3:_(s32) = G_SSHLSAT %0, %2(s32)
47    %5:_(s32) = G_SSHLSAT %3, %4(s32)
48    %7:_(s32) = G_SSHLSAT %5, %6(s32)
49    %9:_(s32) = G_SSHLSAT %7, %8(s32)
50    %10:_(s32) = G_INTRINSIC intrinsic(@llvm.amdgcn.readfirstlane), %9(s32)
51    $sgpr0 = COPY %10(s32)
52    SI_RETURN_TO_EPILOG implicit $sgpr0
53
54...
55---
56name:            sshlsat_i32
57tracksRegLiveness: true
58body:             |
59  bb.0:
60    liveins: $vgpr0
61
62    ; CHECK-LABEL: name: sshlsat_i32
63    ; CHECK: liveins: $vgpr0
64    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
65    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
66    ; CHECK: [[SSHLSAT:%[0-9]+]]:_(s32) = G_SSHLSAT [[COPY]], [[C]](s32)
67    ; CHECK: $vgpr0 = COPY [[SSHLSAT]](s32)
68    ; CHECK: SI_RETURN_TO_EPILOG implicit $vgpr0
69    %0:_(s32) = COPY $vgpr0
70    %2:_(s32) = G_CONSTANT i32 10
71    %3:_(s32) = G_SSHLSAT %0, %2(s32)
72    %4:_(s32) = G_SSHLSAT %3, %2(s32)
73    %5:_(s32) = G_SSHLSAT %4, %2(s32)
74    %6:_(s32) = G_SSHLSAT %5, %2(s32)
75    $vgpr0 = COPY %6(s32)
76    SI_RETURN_TO_EPILOG implicit $vgpr0
77
78...
79---
80name:            sshlsat_i64
81tracksRegLiveness: true
82body:             |
83  bb.0:
84    liveins: $sgpr0, $sgpr1
85
86    ; CHECK-LABEL: name: sshlsat_i64
87    ; CHECK: liveins: $sgpr0, $sgpr1
88    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
89    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
90    ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
91    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 62
92    ; CHECK: [[SSHLSAT:%[0-9]+]]:_(s64) = G_SSHLSAT [[MV]], [[C]](s64)
93    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[SSHLSAT]](s64)
94    ; CHECK: $sgpr0 = COPY [[UV]](s32)
95    ; CHECK: $sgpr1 = COPY [[UV1]](s32)
96    ; CHECK: SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
97    %1:_(s32) = COPY $sgpr0
98    %2:_(s32) = COPY $sgpr1
99    %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32)
100    %4:_(s64) = G_CONSTANT i64 10
101    %11:_(s64) = G_CONSTANT i64 2
102    %5:_(s64) = G_SSHLSAT %0, %4(s64)
103    %6:_(s64) = G_SSHLSAT %5, %4(s64)
104    %7:_(s64) = G_SSHLSAT %6, %4(s64)
105    %8:_(s64) = G_SSHLSAT %7, %4(s64)
106    %9:_(s64) = G_SSHLSAT %8, %4(s64)
107    %10:_(s64) = G_SSHLSAT %9, %4(s64)
108    %12:_(s64) = G_SSHLSAT %10, %11(s64)
109    %13:_(s32), %14:_(s32) = G_UNMERGE_VALUES %12(s64)
110    $sgpr0 = COPY %13(s32)
111    $sgpr1 = COPY %14(s32)
112    SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
113
114...
115---
116name:            ushlsat_1
117tracksRegLiveness: true
118body:             |
119  bb.0:
120    liveins: $vgpr0
121
122    ; CHECK-LABEL: name: ushlsat_1
123    ; CHECK: liveins: $vgpr0
124    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
125    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
126    ; CHECK: [[USHLSAT:%[0-9]+]]:_(s32) = G_USHLSAT [[COPY]], [[C]](s32)
127    ; CHECK: $vgpr0 = COPY [[USHLSAT]](s32)
128    ; CHECK: SI_RETURN_TO_EPILOG implicit $vgpr0
129    %0:_(s32) = COPY $vgpr0
130    %2:_(s32) = G_CONSTANT i32 2
131    %3:_(s32) = G_USHLSAT %0, %2(s32)
132    %4:_(s32) = G_USHLSAT %3, %2(s32)
133    $vgpr0 = COPY %4(s32)
134    SI_RETURN_TO_EPILOG implicit $vgpr0
135
136...
137---
138name:            ushlsat_2
139tracksRegLiveness: true
140body:             |
141  bb.0:
142    liveins: $sgpr0
143
144    ; CHECK-LABEL: name: ushlsat_2
145    ; CHECK: liveins: $sgpr0
146    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
147    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
148    ; CHECK: [[USHLSAT:%[0-9]+]]:_(s32) = G_USHLSAT [[COPY]], [[C]](s32)
149    ; CHECK: $sgpr0 = COPY [[USHLSAT]](s32)
150    ; CHECK: SI_RETURN_TO_EPILOG implicit $sgpr0
151    %0:_(s32) = COPY $sgpr0
152    %2:_(s32) = G_CONSTANT i32 1
153    %4:_(s32) = G_CONSTANT i32 2
154    %6:_(s32) = G_CONSTANT i32 3
155    %8:_(s32) = G_CONSTANT i32 4
156    %3:_(s32) = G_USHLSAT %0, %2(s32)
157    %5:_(s32) = G_USHLSAT %3, %4(s32)
158    %7:_(s32) = G_USHLSAT %5, %6(s32)
159    %9:_(s32) = G_USHLSAT %7, %8(s32)
160    $sgpr0 = COPY %9(s32)
161    SI_RETURN_TO_EPILOG implicit $sgpr0
162
163...
164---
165name:            ushlsat_i32
166tracksRegLiveness: true
167body:             |
168  bb.0:
169    liveins: $vgpr0
170
171    ; CHECK-LABEL: name: ushlsat_i32
172    ; CHECK: liveins: $vgpr0
173    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
174    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
175    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 30
176    ; CHECK: [[USHLSAT:%[0-9]+]]:_(s32) = G_USHLSAT [[COPY]], [[C1]](s32)
177    ; CHECK: [[USHLSAT1:%[0-9]+]]:_(s32) = G_USHLSAT [[USHLSAT]], [[C]](s32)
178    ; CHECK: $vgpr0 = COPY [[USHLSAT1]](s32)
179    ; CHECK: SI_RETURN_TO_EPILOG implicit $vgpr0
180    %0:_(s32) = COPY $vgpr0
181    %2:_(s32) = G_CONSTANT i32 10
182    %3:_(s32) = G_USHLSAT %0, %2(s32)
183    %4:_(s32) = G_USHLSAT %3, %2(s32)
184    %5:_(s32) = G_USHLSAT %4, %2(s32)
185    %6:_(s32) = G_USHLSAT %5, %2(s32)
186    $vgpr0 = COPY %6(s32)
187    SI_RETURN_TO_EPILOG implicit $vgpr0
188
189...
190---
191name:            ushlsat_i64
192tracksRegLiveness: true
193body:             |
194  bb.0:
195    liveins: $sgpr0, $sgpr1
196
197    ; CHECK-LABEL: name: ushlsat_i64
198    ; CHECK: liveins: $sgpr0, $sgpr1
199    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $sgpr0
200    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr1
201    ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
202    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 10
203    ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 60
204    ; CHECK: [[USHLSAT:%[0-9]+]]:_(s64) = G_USHLSAT [[MV]], [[C1]](s64)
205    ; CHECK: [[USHLSAT1:%[0-9]+]]:_(s64) = G_USHLSAT [[USHLSAT]], [[C]](s64)
206    ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[USHLSAT1]](s64)
207    ; CHECK: $sgpr0 = COPY [[UV]](s32)
208    ; CHECK: $sgpr1 = COPY [[UV1]](s32)
209    ; CHECK: SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
210    %1:_(s32) = COPY $sgpr0
211    %2:_(s32) = COPY $sgpr1
212    %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32)
213    %4:_(s64) = G_CONSTANT i64 10
214    %5:_(s64) = G_USHLSAT %0, %4(s64)
215    %6:_(s64) = G_USHLSAT %5, %4(s64)
216    %7:_(s64) = G_USHLSAT %6, %4(s64)
217    %8:_(s64) = G_USHLSAT %7, %4(s64)
218    %9:_(s64) = G_USHLSAT %8, %4(s64)
219    %10:_(s64) = G_USHLSAT %9, %4(s64)
220    %11:_(s64) = G_USHLSAT %10, %4(s64)
221    %12:_(s32), %13:_(s32) = G_UNMERGE_VALUES %11(s64)
222    $sgpr0 = COPY %12(s32)
223    $sgpr1 = COPY %13(s32)
224    SI_RETURN_TO_EPILOG implicit $sgpr0, implicit $sgpr1
225
226...
227