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_ashr_s64_32_s64amt
6 tracksRegLiveness: true
11 ; CHECK-LABEL: name: narrow_ashr_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 31
17 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[UV1]], [[C]](s32)
18 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV1]](s32), [[ASHR]](s32)
19 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
20 %0:_(s64) = COPY $vgpr0_vgpr1
21 %1:_(s64) = G_CONSTANT i64 32
22 %2:_(s64) = G_ASHR %0, %1
23 $vgpr0_vgpr1 = COPY %2
27 name: narrow_ashr_s64_32
28 tracksRegLiveness: true
33 ; CHECK-LABEL: name: narrow_ashr_s64_32
34 ; CHECK: liveins: $vgpr0_vgpr1
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
37 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
38 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
39 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[UV1]], [[C]](s32)
40 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UV1]](s32), [[ASHR]](s32)
41 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
42 %0:_(s64) = COPY $vgpr0_vgpr1
43 %1:_(s32) = G_CONSTANT i32 32
44 %2:_(s64) = G_ASHR %0, %1
45 $vgpr0_vgpr1 = COPY %2
49 name: narrow_ashr_s64_33
50 tracksRegLiveness: true
55 ; CHECK-LABEL: name: narrow_ashr_s64_33
56 ; CHECK: liveins: $vgpr0_vgpr1
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
59 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
60 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
61 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[UV1]], [[C]](s32)
62 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
63 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[UV1]], [[C1]](s32)
64 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[ASHR1]](s32), [[ASHR]](s32)
65 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
66 %0:_(s64) = COPY $vgpr0_vgpr1
67 %1:_(s32) = G_CONSTANT i32 33
68 %2:_(s64) = G_ASHR %0, %1
69 $vgpr0_vgpr1 = COPY %2
73 name: narrow_ashr_s64_31
74 tracksRegLiveness: true
79 ; CHECK-LABEL: name: narrow_ashr_s64_31
80 ; CHECK: liveins: $vgpr0_vgpr1
82 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
83 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
84 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[C]](s32)
85 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ASHR]](s64)
86 %0:_(s64) = COPY $vgpr0_vgpr1
87 %1:_(s32) = G_CONSTANT i32 31
88 %2:_(s64) = G_ASHR %0, %1
89 $vgpr0_vgpr1 = COPY %2
93 name: narrow_ashr_s64_63
94 tracksRegLiveness: true
99 ; CHECK-LABEL: name: narrow_ashr_s64_63
100 ; CHECK: liveins: $vgpr0_vgpr1
102 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
103 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
104 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
105 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[UV1]], [[C]](s32)
106 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[ASHR]](s32), [[ASHR]](s32)
107 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
108 %0:_(s64) = COPY $vgpr0_vgpr1
109 %1:_(s32) = G_CONSTANT i32 63
110 %2:_(s64) = G_ASHR %0, %1
111 $vgpr0_vgpr1 = COPY %2
115 name: narrow_ashr_s64_64
116 tracksRegLiveness: true
119 liveins: $vgpr0_vgpr1
121 ; CHECK-LABEL: name: narrow_ashr_s64_64
122 ; CHECK: liveins: $vgpr0_vgpr1
124 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
125 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[DEF]](s64)
126 %0:_(s64) = COPY $vgpr0_vgpr1
127 %1:_(s32) = G_CONSTANT i32 64
128 %2:_(s64) = G_ASHR %0, %1
129 $vgpr0_vgpr1 = COPY %2
133 name: narrow_ashr_s64_65
134 tracksRegLiveness: true
137 liveins: $vgpr0_vgpr1
139 ; CHECK-LABEL: name: narrow_ashr_s64_65
140 ; CHECK: liveins: $vgpr0_vgpr1
142 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
143 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[DEF]](s64)
144 %0:_(s64) = COPY $vgpr0_vgpr1
145 %1:_(s32) = G_CONSTANT i32 65
146 %2:_(s64) = G_ASHR %0, %1
147 $vgpr0_vgpr1 = COPY %2
151 name: narrow_ashr_s32_16
152 tracksRegLiveness: true
157 ; CHECK-LABEL: name: narrow_ashr_s32_16
158 ; CHECK: liveins: $vgpr0
160 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
161 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
162 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s32)
163 ; CHECK-NEXT: $vgpr0 = COPY [[ASHR]](s32)
164 %0:_(s32) = COPY $vgpr0
165 %1:_(s32) = G_CONSTANT i32 16
166 %2:_(s32) = G_ASHR %0, %1
171 name: narrow_ashr_s32_17
172 tracksRegLiveness: true
177 ; CHECK-LABEL: name: narrow_ashr_s32_17
178 ; CHECK: liveins: $vgpr0
180 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
181 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
182 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s32)
183 ; CHECK-NEXT: $vgpr0 = COPY [[ASHR]](s32)
184 %0:_(s32) = COPY $vgpr0
185 %1:_(s32) = G_CONSTANT i32 17
186 %2:_(s32) = G_ASHR %0, %1
191 name: narrow_ashr_v2s32_17
192 tracksRegLiveness: true
195 liveins: $vgpr0_vgpr1
197 ; CHECK-LABEL: name: narrow_ashr_v2s32_17
198 ; CHECK: liveins: $vgpr0_vgpr1
200 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
201 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
202 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32)
203 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(<2 x s32>) = G_ASHR [[COPY]], [[BUILD_VECTOR]](<2 x s32>)
204 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ASHR]](<2 x s32>)
205 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
206 %1:_(s32) = G_CONSTANT i32 17
207 %2:_(<2 x s32>) = G_BUILD_VECTOR %1, %1
208 %3:_(<2 x s32>) = G_ASHR %0, %2
209 $vgpr0_vgpr1 = COPY %3