347 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s3 4...5---6name: add_64_mask_327tracksRegLiveness: true8body: |9 bb.0:10 liveins: $x0, $x111 ; CHECK-LABEL: name: add_64_mask_3212 ; CHECK: liveins: $x0, $x113 ; CHECK-NEXT: {{ $}}14 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x015 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x116 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %binop_lhs(s64)17 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %binop_rhs(s64)18 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[TRUNC]], [[TRUNC1]]19 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ADD]](s32)20 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)21 ; CHECK-NEXT: RET_ReallyLR implicit $x022 %binop_lhs:_(s64) = COPY $x023 %binop_rhs:_(s64) = COPY $x124 %mask_32:_(s64) = G_CONSTANT i64 429496729525 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs26 %and:_(s64) = G_AND %binop, %mask_3227 $x0 = COPY %and(s64)28 RET_ReallyLR implicit $x029...30---31name: sub_64_mask_3232tracksRegLiveness: true33body: |34 bb.0:35 liveins: $x0, $x136 ; CHECK-LABEL: name: sub_64_mask_3237 ; CHECK: liveins: $x0, $x138 ; CHECK-NEXT: {{ $}}39 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x040 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x141 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %binop_lhs(s64)42 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %binop_rhs(s64)43 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[TRUNC]], [[TRUNC1]]44 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[SUB]](s32)45 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)46 ; CHECK-NEXT: RET_ReallyLR implicit $x047 %binop_lhs:_(s64) = COPY $x048 %binop_rhs:_(s64) = COPY $x149 %mask_32:_(s64) = G_CONSTANT i64 429496729550 %binop:_(s64) = G_SUB %binop_lhs, %binop_rhs51 %and:_(s64) = G_AND %binop, %mask_3252 $x0 = COPY %and(s64)53 RET_ReallyLR implicit $x054...55---56name: mul_64_mask_3257tracksRegLiveness: true58body: |59 bb.0:60 liveins: $x0, $x161 ; CHECK-LABEL: name: mul_64_mask_3262 ; CHECK: liveins: $x0, $x163 ; CHECK-NEXT: {{ $}}64 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x065 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x166 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %binop_lhs(s64)67 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %binop_rhs(s64)68 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[TRUNC]], [[TRUNC1]]69 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[MUL]](s32)70 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)71 ; CHECK-NEXT: RET_ReallyLR implicit $x072 %binop_lhs:_(s64) = COPY $x073 %binop_rhs:_(s64) = COPY $x174 %mask_32:_(s64) = G_CONSTANT i64 429496729575 %binop:_(s64) = G_MUL %binop_lhs, %binop_rhs76 %and:_(s64) = G_AND %binop, %mask_3277 $x0 = COPY %and(s64)78 RET_ReallyLR implicit $x079...80---81name: and_64_mask_3282tracksRegLiveness: true83body: |84 bb.0:85 liveins: $x0, $x186 ; CHECK-LABEL: name: and_64_mask_3287 ; CHECK: liveins: $x0, $x188 ; CHECK-NEXT: {{ $}}89 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x090 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x191 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %binop_lhs(s64)92 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %binop_rhs(s64)93 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[TRUNC1]]94 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[AND]](s32)95 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)96 ; CHECK-NEXT: RET_ReallyLR implicit $x097 %binop_lhs:_(s64) = COPY $x098 %binop_rhs:_(s64) = COPY $x199 %mask_32:_(s64) = G_CONSTANT i64 4294967295100 %binop:_(s64) = G_AND %binop_lhs, %binop_rhs101 %and:_(s64) = G_AND %binop, %mask_32102 $x0 = COPY %and(s64)103 RET_ReallyLR implicit $x0104...105---106name: or_64_mask_32107tracksRegLiveness: true108body: |109 bb.0:110 liveins: $x0, $x1111 ; CHECK-LABEL: name: or_64_mask_32112 ; CHECK: liveins: $x0, $x1113 ; CHECK-NEXT: {{ $}}114 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0115 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1116 ; CHECK-NEXT: %mask_32:_(s64) = G_CONSTANT i64 4294967295117 ; CHECK-NEXT: %binop:_(s64) = G_SUB %binop_lhs, %binop_rhs118 ; CHECK-NEXT: %and:_(s64) = G_OR %binop, %mask_32119 ; CHECK-NEXT: $x0 = COPY %and(s64)120 ; CHECK-NEXT: RET_ReallyLR implicit $x0121 %binop_lhs:_(s64) = COPY $x0122 %binop_rhs:_(s64) = COPY $x1123 %mask_32:_(s64) = G_CONSTANT i64 4294967295124 %binop:_(s64) = G_SUB %binop_lhs, %binop_rhs125 %and:_(s64) = G_OR %binop, %mask_32126 $x0 = COPY %and(s64)127 RET_ReallyLR implicit $x0128...129---130name: xor_64_mask_32131tracksRegLiveness: true132body: |133 bb.0:134 liveins: $x0, $x1135 ; CHECK-LABEL: name: xor_64_mask_32136 ; CHECK: liveins: $x0, $x1137 ; CHECK-NEXT: {{ $}}138 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0139 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1140 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %binop_lhs(s64)141 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %binop_rhs(s64)142 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[TRUNC]], [[TRUNC1]]143 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[XOR]](s32)144 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)145 ; CHECK-NEXT: RET_ReallyLR implicit $x0146 %binop_lhs:_(s64) = COPY $x0147 %binop_rhs:_(s64) = COPY $x1148 %mask_32:_(s64) = G_CONSTANT i64 4294967295149 %binop:_(s64) = G_XOR %binop_lhs, %binop_rhs150 %and:_(s64) = G_AND %binop, %mask_32151 $x0 = COPY %and(s64)152 RET_ReallyLR implicit $x0153...154---155name: walk_thru_copy156tracksRegLiveness: true157body: |158 bb.0:159 liveins: $x0, $x1160 ; CHECK-LABEL: name: walk_thru_copy161 ; CHECK: liveins: $x0, $x1162 ; CHECK-NEXT: {{ $}}163 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0164 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1165 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC %binop_lhs(s64)166 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC %binop_rhs(s64)167 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[TRUNC]], [[TRUNC1]]168 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[ADD]](s32)169 ; CHECK-NEXT: $x0 = COPY [[ZEXT]](s64)170 ; CHECK-NEXT: RET_ReallyLR implicit $x0171 %binop_lhs:_(s64) = COPY $x0172 %binop_rhs:_(s64) = COPY $x1173 %mask_32:_(s64) = G_CONSTANT i64 4294967295174 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs175 %copy:_(s64) = COPY %binop176 %and:_(s64) = G_AND %copy, %mask_32177 $x0 = COPY %and(s64)178 RET_ReallyLR implicit $x0179...180---181name: dont_combine_zext_not_free_add_64_mask_16182tracksRegLiveness: true183body: |184 bb.0:185 liveins: $x0, $x1186 ; CHECK-LABEL: name: dont_combine_zext_not_free_add_64_mask_16187 ; CHECK: liveins: $x0, $x1188 ; CHECK-NEXT: {{ $}}189 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0190 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1191 ; CHECK-NEXT: %mask_16:_(s64) = G_CONSTANT i64 65535192 ; CHECK-NEXT: %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs193 ; CHECK-NEXT: %and:_(s64) = G_AND %binop, %mask_16194 ; CHECK-NEXT: $x0 = COPY %and(s64)195 ; CHECK-NEXT: RET_ReallyLR implicit $x0196 %binop_lhs:_(s64) = COPY $x0197 %binop_rhs:_(s64) = COPY $x1198 %mask_16:_(s64) = G_CONSTANT i64 65535199 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs200 %and:_(s64) = G_AND %binop, %mask_16201 $x0 = COPY %and(s64)202 RET_ReallyLR implicit $x0203...204---205name: dont_combine_zext_not_free_add_64_mask_8206tracksRegLiveness: true207body: |208 bb.0:209 liveins: $x0, $x1210 ; CHECK-LABEL: name: dont_combine_zext_not_free_add_64_mask_8211 ; CHECK: liveins: $x0, $x1212 ; CHECK-NEXT: {{ $}}213 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0214 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1215 ; CHECK-NEXT: %mask_8:_(s64) = G_CONSTANT i64 255216 ; CHECK-NEXT: %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs217 ; CHECK-NEXT: %and:_(s64) = G_AND %binop, %mask_8218 ; CHECK-NEXT: $x0 = COPY %and(s64)219 ; CHECK-NEXT: RET_ReallyLR implicit $x0220 %binop_lhs:_(s64) = COPY $x0221 %binop_rhs:_(s64) = COPY $x1222 %mask_8:_(s64) = G_CONSTANT i64 255223 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs224 %and:_(s64) = G_AND %binop, %mask_8225 $x0 = COPY %and(s64)226 RET_ReallyLR implicit $x0227...228---229name: dont_combine_not_a_mask230tracksRegLiveness: true231body: |232 bb.0:233 liveins: $x0, $x1234 ; CHECK-LABEL: name: dont_combine_not_a_mask235 ; CHECK: liveins: $x0, $x1236 ; CHECK-NEXT: {{ $}}237 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0238 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1239 ; CHECK-NEXT: %not_a_mask:_(s64) = G_CONSTANT i64 26240 ; CHECK-NEXT: %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs241 ; CHECK-NEXT: %and:_(s64) = G_AND %binop, %not_a_mask242 ; CHECK-NEXT: $x0 = COPY %and(s64)243 ; CHECK-NEXT: RET_ReallyLR implicit $x0244 %binop_lhs:_(s64) = COPY $x0245 %binop_rhs:_(s64) = COPY $x1246 %not_a_mask:_(s64) = G_CONSTANT i64 26247 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs248 %and:_(s64) = G_AND %binop, %not_a_mask249 $x0 = COPY %and(s64)250 RET_ReallyLR implicit $x0251...252---253name: dont_combine_more_than_one_use254tracksRegLiveness: true255body: |256 bb.0:257 liveins: $x0, $x1258 ; CHECK-LABEL: name: dont_combine_more_than_one_use259 ; CHECK: liveins: $x0, $x1260 ; CHECK-NEXT: {{ $}}261 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0262 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1263 ; CHECK-NEXT: %not_a_mask:_(s64) = G_CONSTANT i64 26264 ; CHECK-NEXT: %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs265 ; CHECK-NEXT: %and:_(s64) = G_AND %binop, %not_a_mask266 ; CHECK-NEXT: %or:_(s64) = G_OR %and, %binop267 ; CHECK-NEXT: $x0 = COPY %or(s64)268 ; CHECK-NEXT: RET_ReallyLR implicit $x0269 %binop_lhs:_(s64) = COPY $x0270 %binop_rhs:_(s64) = COPY $x1271 %not_a_mask:_(s64) = G_CONSTANT i64 26272 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs273 %and:_(s64) = G_AND %binop, %not_a_mask274 %or:_(s64) = G_OR %and, %binop275 $x0 = COPY %or(s64)276 RET_ReallyLR implicit $x0277...278---279name: dont_combine_vector280tracksRegLiveness: true281body: |282 bb.0:283 liveins: $q0, $q1284 ; CHECK-LABEL: name: dont_combine_vector285 ; CHECK: liveins: $q0, $q1286 ; CHECK-NEXT: {{ $}}287 ; CHECK-NEXT: %binop_lhs:_(<2 x s64>) = COPY $q0288 ; CHECK-NEXT: %binop_rhs:_(<2 x s64>) = COPY $q1289 ; CHECK-NEXT: %mask_elt:_(s64) = G_CONSTANT i64 4294967295290 ; CHECK-NEXT: %mask:_(<2 x s64>) = G_BUILD_VECTOR %mask_elt(s64), %mask_elt(s64)291 ; CHECK-NEXT: %binop:_(<2 x s64>) = G_ADD %binop_lhs, %binop_rhs292 ; CHECK-NEXT: %and:_(<2 x s64>) = G_AND %binop, %mask293 ; CHECK-NEXT: $q0 = COPY %and(<2 x s64>)294 ; CHECK-NEXT: RET_ReallyLR implicit $q0295 %binop_lhs:_(<2 x s64>) = COPY $q0296 %binop_rhs:_(<2 x s64>) = COPY $q1297 %mask_elt:_(s64) = G_CONSTANT i64 4294967295298 %mask:_(<2 x s64>) = G_BUILD_VECTOR %mask_elt, %mask_elt299 %binop:_(<2 x s64>) = G_ADD %binop_lhs, %binop_rhs300 %and:_(<2 x s64>) = G_AND %binop, %mask301 $q0 = COPY %and(<2 x s64>)302 RET_ReallyLR implicit $q0303...304---305name: dont_combine_add_64_mask_64306tracksRegLiveness: true307body: |308 bb.0:309 liveins: $x0, $x1310 ; CHECK-LABEL: name: dont_combine_add_64_mask_64311 ; CHECK: liveins: $x0, $x1312 ; CHECK-NEXT: {{ $}}313 ; CHECK-NEXT: %binop_lhs:_(s64) = COPY $x0314 ; CHECK-NEXT: %binop_rhs:_(s64) = COPY $x1315 ; CHECK-NEXT: %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs316 ; CHECK-NEXT: $x0 = COPY %binop(s64)317 ; CHECK-NEXT: RET_ReallyLR implicit $x0318 %binop_lhs:_(s64) = COPY $x0319 %binop_rhs:_(s64) = COPY $x1320 %mask_64:_(s64) = G_CONSTANT i64 18446744073709551615321 %binop:_(s64) = G_ADD %binop_lhs, %binop_rhs322 %and:_(s64) = G_AND %binop, %mask_64323 $x0 = COPY %and(s64)324 RET_ReallyLR implicit $x0325...326---327name: dont_combine_copy_from_physreg328tracksRegLiveness: true329body: |330 bb.0:331 liveins: $x0, $x1332 ; CHECK-LABEL: name: dont_combine_copy_from_physreg333 ; CHECK: liveins: $x0, $x1334 ; CHECK-NEXT: {{ $}}335 ; CHECK-NEXT: %copy_from_physreg:_(s64) = COPY $x0336 ; CHECK-NEXT: %mask_32:_(s64) = G_CONSTANT i64 4294967295337 ; CHECK-NEXT: %and:_(s64) = G_AND %copy_from_physreg, %mask_32338 ; CHECK-NEXT: $x0 = COPY %and(s64)339 ; CHECK-NEXT: RET_ReallyLR implicit $x0340 %copy_from_physreg:_(s64) = COPY $x0341 %binop_rhs:_(s64) = COPY $x1342 %mask_32:_(s64) = G_CONSTANT i64 4294967295343 %copy:_(s64) = COPY %copy_from_physreg344 %and:_(s64) = G_AND %copy, %mask_32345 $x0 = COPY %and(s64)346 RET_ReallyLR implicit $x0347