1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - -mtriple=aarch64-unknown-unknown -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s | FileCheck %s
4 name: test_combine_anyext_trunc
8 ; CHECK-LABEL: name: test_combine_anyext_trunc
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
10 ; CHECK: $x1 = COPY [[COPY]](s64)
12 %1:_(s32) = G_TRUNC %0(s64)
13 %2:_(s64) = G_ANYEXT %1(s32)
17 name: test_combine_anyext_trunc_vec
21 ; CHECK-LABEL: name: test_combine_anyext_trunc_vec
22 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
23 ; CHECK: $q0 = COPY [[COPY]](<2 x s64>)
24 %0:_(<2 x s64>) = COPY $q0
25 %1:_(<2 x s32>) = G_TRUNC %0(<2 x s64>)
26 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
27 $q0 = COPY %2(<2 x s64>)
30 name: test_combine_anyext_anyext
34 ; CHECK-LABEL: name: test_combine_anyext_anyext
35 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
36 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s16)
37 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
39 %1:_(s32) = G_ANYEXT %0(s16)
40 %2:_(s64) = G_ANYEXT %1(s32)
44 name: test_combine_anyext_anyext_vec
48 ; CHECK-LABEL: name: test_combine_anyext_anyext_vec
49 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
50 ; CHECK: [[ANYEXT:%[0-9]+]]:_(<2 x s64>) = G_ANYEXT [[COPY]](<2 x s16>)
51 ; CHECK: $q0 = COPY [[ANYEXT]](<2 x s64>)
52 %0:_(<2 x s16>) = COPY $s0
53 %1:_(<2 x s32>) = G_ANYEXT %0(<2 x s16>)
54 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
55 $q0 = COPY %2(<2 x s64>)
58 name: test_combine_anyext_sext
62 ; CHECK-LABEL: name: test_combine_anyext_sext
63 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
64 ; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
65 ; CHECK: $x0 = COPY [[SEXT]](s64)
67 %1:_(s32) = G_SEXT %0(s16)
68 %2:_(s64) = G_ANYEXT %1(s32)
72 name: test_combine_anyext_sext_vec
76 ; CHECK-LABEL: name: test_combine_anyext_sext_vec
77 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
78 ; CHECK: [[SEXT:%[0-9]+]]:_(<2 x s64>) = G_SEXT [[COPY]](<2 x s16>)
79 ; CHECK: $q0 = COPY [[SEXT]](<2 x s64>)
80 %0:_(<2 x s16>) = COPY $s0
81 %1:_(<2 x s32>) = G_SEXT %0(<2 x s16>)
82 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
83 $q0 = COPY %2(<2 x s64>)
86 name: test_combine_anyext_zext
90 ; CHECK-LABEL: name: test_combine_anyext_zext
91 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
92 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
93 ; CHECK: $x0 = COPY [[ZEXT]](s64)
95 %1:_(s32) = G_ZEXT %0(s16)
96 %2:_(s64) = G_ANYEXT %1(s32)
100 name: test_combine_anyext_zext_vec
104 ; CHECK-LABEL: name: test_combine_anyext_zext_vec
105 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
106 ; CHECK: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s16>)
107 ; CHECK: $q0 = COPY [[ZEXT]](<2 x s64>)
108 %0:_(<2 x s16>) = COPY $s0
109 %1:_(<2 x s32>) = G_ZEXT %0(<2 x s16>)
110 %2:_(<2 x s64>) = G_ANYEXT %1(<2 x s32>)
111 $q0 = COPY %2(<2 x s64>)
114 name: test_combine_sext_sext
118 ; CHECK-LABEL: name: test_combine_sext_sext
119 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
120 ; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
121 ; CHECK: $x0 = COPY [[SEXT]](s64)
123 %1:_(s32) = G_SEXT %0(s16)
124 %2:_(s64) = G_SEXT %1(s32)
128 name: test_combine_sext_sext_vec
132 ; CHECK-LABEL: name: test_combine_sext_sext_vec
133 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
134 ; CHECK: [[SEXT:%[0-9]+]]:_(<2 x s64>) = G_SEXT [[COPY]](<2 x s16>)
135 ; CHECK: $q0 = COPY [[SEXT]](<2 x s64>)
136 %0:_(<2 x s16>) = COPY $s0
137 %1:_(<2 x s32>) = G_SEXT %0(<2 x s16>)
138 %2:_(<2 x s64>) = G_SEXT %1(<2 x s32>)
139 $q0 = COPY %2(<2 x s64>)
142 name: test_combine_sext_zext
146 ; CHECK-LABEL: name: test_combine_sext_zext
147 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
148 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
149 ; CHECK: $x0 = COPY [[ZEXT]](s64)
151 %1:_(s32) = G_ZEXT %0(s16)
152 %2:_(s64) = G_SEXT %1(s32)
156 name: test_combine_sext_zext_vec
160 ; CHECK-LABEL: name: test_combine_sext_zext_vec
161 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
162 ; CHECK: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s16>)
163 ; CHECK: $q0 = COPY [[ZEXT]](<2 x s64>)
164 %0:_(<2 x s16>) = COPY $s0
165 %1:_(<2 x s32>) = G_ZEXT %0(<2 x s16>)
166 %2:_(<2 x s64>) = G_SEXT %1(<2 x s32>)
167 $q0 = COPY %2(<2 x s64>)
170 name: test_combine_zext_zext
174 ; CHECK-LABEL: name: test_combine_zext_zext
175 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
176 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
177 ; CHECK: $x0 = COPY [[ZEXT]](s64)
179 %1:_(s32) = G_ZEXT %0(s16)
180 %2:_(s64) = G_ZEXT %1(s32)
184 name: test_combine_zext_zext_vec
188 ; CHECK-LABEL: name: test_combine_zext_zext_vec
189 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
190 ; CHECK: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s16>)
191 ; CHECK: $q0 = COPY [[ZEXT]](<2 x s64>)
192 %0:_(<2 x s16>) = COPY $s0
193 %1:_(<2 x s32>) = G_ZEXT %0(<2 x s16>)
194 %2:_(<2 x s64>) = G_ZEXT %1(<2 x s32>)
195 $q0 = COPY %2(<2 x s64>)