# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py # RUN: llc -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s --- name: binop_with_neg_or tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_or ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_OR %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %neg_y, %c %dst:_(s64) = G_OR %a, %add $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_or_commuted tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_or_commuted ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_OR %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %neg_y, %c %dst:_(s64) = G_OR %add, %a $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_xor tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_xor ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_XOR %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %neg_y, %c %dst:_(s64) = G_XOR %a, %add $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_xor_commuted tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_xor_commuted ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_XOR %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %c, %neg_y %dst:_(s64) = G_XOR %add, %a $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_and tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_and ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_AND %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %neg_y, %c %dst:_(s64) = G_AND %a, %add $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_and_commuted_and tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_and_commuted_and ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_AND %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %c, %neg_y %dst:_(s64) = G_AND %add, %a $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_and_commuted_add tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_and_commuted_add ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB %b, %c ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[SUB]], %mone ; CHECK-NEXT: %dst:_(s64) = G_AND %a, [[XOR]] ; CHECK-NEXT: $x0 = COPY %dst(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %c, %neg_y %dst:_(s64) = G_AND %a, %add $x0 = COPY %dst RET_ReallyLR implicit $x0 ... --- name: binop_with_neg_and_one_use tracksRegLiveness: true body: | bb.0: liveins: $x0, $x1, $x2, $x3 ; CHECK-LABEL: name: binop_with_neg_and_one_use ; CHECK: liveins: $x0, $x1, $x2, $x3 ; CHECK-NEXT: {{ $}} ; CHECK-NEXT: %a:_(s64) = COPY $x0 ; CHECK-NEXT: %b:_(s64) = COPY $x1 ; CHECK-NEXT: %c:_(s64) = COPY $x2 ; CHECK-NEXT: %mone:_(s64) = G_CONSTANT i64 -1 ; CHECK-NEXT: %neg_y:_(s64) = G_XOR %b, %mone ; CHECK-NEXT: %add:_(s64) = G_ADD %neg_y, %c ; CHECK-NEXT: %dst:_(s64) = G_AND %a, %add ; CHECK-NEXT: %and2:_(s64) = G_AND %neg_y, %dst ; CHECK-NEXT: $x0 = COPY %and2(s64) ; CHECK-NEXT: RET_ReallyLR implicit $x0 %a:_(s64) = COPY $x0 %b:_(s64) = COPY $x1 %c:_(s64) = COPY $x2 %mone:_(s64) = G_CONSTANT i64 -1 %neg_y:_(s64) = G_XOR %mone, %b %add:_(s64) = G_ADD %neg_y, %c %dst:_(s64) = G_AND %a, %add %and2:_(s64) = G_AND %neg_y, %dst $x0 = COPY %and2 RET_ReallyLR implicit $x0 ...