Skip to content

Commit 7f26693

Browse files
committed
Revert "[AArch64] Precommit test for D137069; NFC"
This reverts commit 281f213.
1 parent 26382a4 commit 7f26693

File tree

1 file changed

+7
-89
lines changed

1 file changed

+7
-89
lines changed

llvm/test/CodeGen/AArch64/addsub.ll

Lines changed: 7 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ if.end: ; preds = %if.then, %lor.lhs.f
694694
ret i32 undef
695695
}
696696

697-
; ((X << C) - Y) + Z --> (Z - Y) + (X << C)
697+
; ((X >> C) - Y) + Z --> (Z - Y) + (X >> C)
698698
define i32 @commute_subop0(i32 %x, i32 %y, i32 %z) {
699699
; CHECK-LABEL: commute_subop0:
700700
; CHECK: // %bb.0:
@@ -707,7 +707,7 @@ define i32 @commute_subop0(i32 %x, i32 %y, i32 %z) {
707707
ret i32 %add
708708
}
709709

710-
; ((X >> C) - Y) + Z --> (Z - Y) + (X >> C)
710+
; ((X << C) - Y) + Z --> (Z - Y) + (X << C)
711711
define i32 @commute_subop0_lshr(i32 %x, i32 %y, i32 %z) {
712712
; CHECK-LABEL: commute_subop0_lshr:
713713
; CHECK: // %bb.0:
@@ -721,7 +721,7 @@ define i32 @commute_subop0_lshr(i32 %x, i32 %y, i32 %z) {
721721
ret i32 %add
722722
}
723723

724-
; ((X >> C) - Y) + Z --> (Z - Y) + (X >> C)
724+
; ((X << C) - Y) + Z --> (Z - Y) + (X << C)
725725
define i32 @commute_subop0_ashr(i32 %x, i32 %y, i32 %z) {
726726
; CHECK-LABEL: commute_subop0_ashr:
727727
; CHECK: // %bb.0:
@@ -735,89 +735,7 @@ define i32 @commute_subop0_ashr(i32 %x, i32 %y, i32 %z) {
735735
ret i32 %add
736736
}
737737

738-
; ((sext X) - Y) + Z --> (Z - Y) + (sext X)
739-
define i64 @commute_subop0_sext(i32 %x, i64 %y, i64 %z) {
740-
; CHECK-LABEL: commute_subop0_sext:
741-
; CHECK: // %bb.0:
742-
; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
743-
; CHECK-NEXT: sxtw x8, w0
744-
; CHECK-NEXT: sub x8, x8, x1
745-
; CHECK-NEXT: add x0, x8, x2
746-
; CHECK-NEXT: ret
747-
%sext = sext i32 %x to i64
748-
%sub = sub i64 %sext, %y
749-
%add = add i64 %sub, %z
750-
ret i64 %add
751-
}
752-
753-
; ((sext_inreg X) - Y) + Z --> (Z - Y) + (sext_inreg X)
754-
define i64 @commute_subop0_sext_inreg(i64 %x, i64 %y, i64 %z) {
755-
; CHECK-LABEL: commute_subop0_sext_inreg:
756-
; CHECK: // %bb.0:
757-
; CHECK-NEXT: sxth x8, w0
758-
; CHECK-NEXT: sub x8, x8, x1
759-
; CHECK-NEXT: add x0, x8, x2
760-
; CHECK-NEXT: ret
761-
%shl = shl i64 %x, 48
762-
%ashr = ashr i64 %shl, 48
763-
%sub = sub i64 %ashr, %y
764-
%add = add i64 %sub, %z
765-
ret i64 %add
766-
}
767-
768-
; ((zext X) - Y) + Z --> (Z - Y) + (zext X)
769-
define i32 @commute_subop0_zext(i16 %x, i32 %y, i32 %z) {
770-
; CHECK-LABEL: commute_subop0_zext:
771-
; CHECK: // %bb.0:
772-
; CHECK-NEXT: and w8, w0, #0xffff
773-
; CHECK-NEXT: sub w8, w8, w1
774-
; CHECK-NEXT: add w0, w8, w2
775-
; CHECK-NEXT: ret
776-
%zext = zext i16 %x to i32
777-
%sub = sub i32 %zext, %y
778-
%add = add i32 %sub, %z
779-
ret i32 %add
780-
}
781-
782-
783-
; ((anyext X) - Y) + Z --> (Z - Y) + (anyext X)
784-
define i8 @commute_subop0_anyext(i16 %a, i16 %b, i32 %c) {
785-
; CHECK-LABEL: commute_subop0_anyext:
786-
; CHECK: // %bb.0:
787-
; CHECK-NEXT: mov w8, #222
788-
; CHECK-NEXT: mov w9, #111
789-
; CHECK-NEXT: mul w8, w1, w8
790-
; CHECK-NEXT: neg w8, w8
791-
; CHECK-NEXT: madd w8, w0, w9, w8
792-
; CHECK-NEXT: add w8, w8, w2
793-
; CHECK-NEXT: add w0, w8, w8, lsl #5
794-
; CHECK-NEXT: ret
795-
%aa = mul i16 %a, 111
796-
%bb = mul i16 %b, 222
797-
%a_32 = zext i16 %aa to i32
798-
%b_32 = zext i16 %bb to i32
799-
%sub = sub i32 %a_32, %b_32
800-
%add = add i32 %sub, %c
801-
%trunc = trunc i32 %add to i8
802-
%r = mul i8 %trunc, 33
803-
ret i8 %r
804-
}
805-
806-
; ((X and C) - Y) + Z --> (Z - Y) + (X and C)
807-
define i32 @commute_subop0_and(i32 %x, i32 %y, i32 %z) {
808-
; CHECK-LABEL: commute_subop0_and:
809-
; CHECK: // %bb.0:
810-
; CHECK-NEXT: and w8, w0, #0xff
811-
; CHECK-NEXT: sub w8, w8, w1
812-
; CHECK-NEXT: add w0, w8, w2
813-
; CHECK-NEXT: ret
814-
%and = and i32 %x, 255
815-
%sub = sub i32 %and, %y
816-
%add = add i32 %sub, %z
817-
ret i32 %add
818-
}
819-
820-
; Z + ((X << C) - Y) --> (Z - Y) + (X << C)
738+
; Z + ((X >> C) - Y) --> (Z - Y) + (X >> C)
821739
define i32 @commute_subop0_cadd(i32 %x, i32 %y, i32 %z) {
822740
; CHECK-LABEL: commute_subop0_cadd:
823741
; CHECK: // %bb.0:
@@ -830,7 +748,7 @@ define i32 @commute_subop0_cadd(i32 %x, i32 %y, i32 %z) {
830748
ret i32 %add
831749
}
832750

833-
; Y + ((X << C) - X) --> (Y - X) + (X << C)
751+
; Y + ((X >> C) - X) --> (Y - X) + (X >> C)
834752
define i32 @commute_subop0_mul(i32 %x, i32 %y) {
835753
; CHECK-LABEL: commute_subop0_mul:
836754
; CHECK: // %bb.0:
@@ -842,7 +760,7 @@ define i32 @commute_subop0_mul(i32 %x, i32 %y) {
842760
ret i32 %add
843761
}
844762

845-
; negative case for ((X << C) - Y) + Z --> (Z - Y) + (X << C)
763+
; negative case for ((X >> C) - Y) + Z --> (Z - Y) + (X >> C)
846764
; Y can't be constant to avoid dead loop
847765
define i32 @commute_subop0_zconst(i32 %x, i32 %y) {
848766
; CHECK-LABEL: commute_subop0_zconst:
@@ -857,7 +775,7 @@ define i32 @commute_subop0_zconst(i32 %x, i32 %y) {
857775
ret i32 %add
858776
}
859777

860-
; negative case for ((X << C) - Y) + Z --> (Z - Y) + (X << C)
778+
; negative case for ((X >> C) - Y) + Z --> (Z - Y) + (X >> C)
861779
; Y can't be shift C also to avoid dead loop
862780
define i32 @commute_subop0_zshiftc_oneuse(i32 %x, i32 %y, i32 %z) {
863781
; CHECK-LABEL: commute_subop0_zshiftc_oneuse:

0 commit comments

Comments
 (0)