1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -run-pass=amdgpu-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
5 name: narrow_lshr_s64_32_s64amt
6 tracksRegLiveness: true
11 ; CHECK-LABEL: name: narrow_lshr_s64_32_s64amt
12 ; CHECK: liveins: $vgpr0_vgpr1
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
15 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
16 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
17 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV1]](s32), [[C]](s32)
18 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
19 %0:_(s64) = COPY $vgpr0_vgpr1
20 %1:_(s64) = G_CONSTANT i64 32
21 %2:_(s64) = G_LSHR %0, %1
22 $vgpr0_vgpr1 = COPY %2
26 name: narrow_lshr_s64_32
27 tracksRegLiveness: true
32 ; CHECK-LABEL: name: narrow_lshr_s64_32
33 ; CHECK: liveins: $vgpr0_vgpr1
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
36 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
37 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
38 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV1]](s32), [[C]](s32)
39 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
40 %0:_(s64) = COPY $vgpr0_vgpr1
41 %1:_(s32) = G_CONSTANT i32 32
42 %2:_(s64) = G_LSHR %0, %1
43 $vgpr0_vgpr1 = COPY %2
47 name: narrow_lshr_s64_33
48 tracksRegLiveness: true
53 ; CHECK-LABEL: name: narrow_lshr_s64_33
54 ; CHECK: liveins: $vgpr0_vgpr1
56 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
57 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
58 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
59 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
60 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
61 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[LSHR]](s32), [[C1]](s32)
62 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
63 %0:_(s64) = COPY $vgpr0_vgpr1
64 %1:_(s32) = G_CONSTANT i32 33
65 %2:_(s64) = G_LSHR %0, %1
66 $vgpr0_vgpr1 = COPY %2
70 name: narrow_lshr_s64_31
71 tracksRegLiveness: true
76 ; CHECK-LABEL: name: narrow_lshr_s64_31
77 ; CHECK: liveins: $vgpr0_vgpr1
79 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
80 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
81 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s32)
82 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[LSHR]](s64)
83 %0:_(s64) = COPY $vgpr0_vgpr1
84 %1:_(s32) = G_CONSTANT i32 31
85 %2:_(s64) = G_LSHR %0, %1
86 $vgpr0_vgpr1 = COPY %2
90 name: narrow_lshr_s64_63
91 tracksRegLiveness: true
96 ; CHECK-LABEL: name: narrow_lshr_s64_63
97 ; CHECK: liveins: $vgpr0_vgpr1
99 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
100 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
101 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
102 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[UV1]], [[C]](s32)
103 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
104 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[LSHR]](s32), [[C1]](s32)
105 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
106 %0:_(s64) = COPY $vgpr0_vgpr1
107 %1:_(s32) = G_CONSTANT i32 63
108 %2:_(s64) = G_LSHR %0, %1
109 $vgpr0_vgpr1 = COPY %2
113 name: narrow_lshr_s64_64
114 tracksRegLiveness: true
117 liveins: $vgpr0_vgpr1
119 ; CHECK-LABEL: name: narrow_lshr_s64_64
120 ; CHECK: liveins: $vgpr0_vgpr1
122 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
123 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[DEF]](s64)
124 %0:_(s64) = COPY $vgpr0_vgpr1
125 %1:_(s32) = G_CONSTANT i32 64
126 %2:_(s64) = G_LSHR %0, %1
127 $vgpr0_vgpr1 = COPY %2
131 name: narrow_lshr_s64_65
132 tracksRegLiveness: true
135 liveins: $vgpr0_vgpr1
137 ; CHECK-LABEL: name: narrow_lshr_s64_65
138 ; CHECK: liveins: $vgpr0_vgpr1
140 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
141 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[DEF]](s64)
142 %0:_(s64) = COPY $vgpr0_vgpr1
143 %1:_(s32) = G_CONSTANT i32 65
144 %2:_(s64) = G_LSHR %0, %1
145 $vgpr0_vgpr1 = COPY %2
149 name: narrow_lshr_s32_16
150 tracksRegLiveness: true
155 ; CHECK-LABEL: name: narrow_lshr_s32_16
156 ; CHECK: liveins: $vgpr0
158 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
159 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
160 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
161 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
162 %0:_(s32) = COPY $vgpr0
163 %1:_(s32) = G_CONSTANT i32 16
164 %2:_(s32) = G_LSHR %0, %1
169 name: narrow_lshr_s32_17
170 tracksRegLiveness: true
175 ; CHECK-LABEL: name: narrow_lshr_s32_17
176 ; CHECK: liveins: $vgpr0
178 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
179 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
180 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
181 ; CHECK-NEXT: $vgpr0 = COPY [[LSHR]](s32)
182 %0:_(s32) = COPY $vgpr0
183 %1:_(s32) = G_CONSTANT i32 17
184 %2:_(s32) = G_LSHR %0, %1
189 name: narrow_lshr_v2s32_17
190 tracksRegLiveness: true
193 liveins: $vgpr0_vgpr1
195 ; CHECK-LABEL: name: narrow_lshr_v2s32_17
196 ; CHECK: liveins: $vgpr0_vgpr1
198 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
199 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
200 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32)
201 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<2 x s32>) = G_LSHR [[COPY]], [[BUILD_VECTOR]](<2 x s32>)
202 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[LSHR]](<2 x s32>)
203 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
204 %1:_(s32) = G_CONSTANT i32 17
205 %2:_(<2 x s32>) = G_BUILD_VECTOR %1, %1
206 %3:_(<2 x s32>) = G_LSHR %0, %2
207 $vgpr0_vgpr1 = COPY %3