[llvm] dbac0e8 - [AArch64] Mark smull and umull as commutative.
David Green via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 13 01:24:20 PDT 2022
Author: David Green
Date: 2022-06-13T09:24:15+01:00
New Revision: dbac0e83d14cc3dcbb22af826ad550dfb6431a61
URL: https://github.com/llvm/llvm-project/commit/dbac0e83d14cc3dcbb22af826ad550dfb6431a61
DIFF: https://github.com/llvm/llvm-project/commit/dbac0e83d14cc3dcbb22af826ad550dfb6431a61.diff
LOG: [AArch64] Mark smull and umull as commutative.
Added:
Modified:
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/test/CodeGen/AArch64/highextractbitcast.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
index 7f32465a94044..c6d902908db10 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
@@ -669,8 +669,10 @@ def AArch64NvCast : SDNode<"AArch64ISD::NVCAST", SDTUnaryOp>;
def SDT_AArch64mull : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
SDTCisSameAs<1, 2>]>;
-def AArch64smull : SDNode<"AArch64ISD::SMULL", SDT_AArch64mull>;
-def AArch64umull : SDNode<"AArch64ISD::UMULL", SDT_AArch64mull>;
+def AArch64smull : SDNode<"AArch64ISD::SMULL", SDT_AArch64mull,
+ [SDNPCommutative]>;
+def AArch64umull : SDNode<"AArch64ISD::UMULL", SDT_AArch64mull,
+ [SDNPCommutative]>;
def AArch64frecpe : SDNode<"AArch64ISD::FRECPE", SDTFPUnaryOp>;
def AArch64frecps : SDNode<"AArch64ISD::FRECPS", SDTFPBinOp>;
diff --git a/llvm/test/CodeGen/AArch64/highextractbitcast.ll b/llvm/test/CodeGen/AArch64/highextractbitcast.ll
index 89d3d2187b405..e7b2a49d699ea 100644
--- a/llvm/test/CodeGen/AArch64/highextractbitcast.ll
+++ b/llvm/test/CodeGen/AArch64/highextractbitcast.ll
@@ -256,18 +256,16 @@ entry:
define <4 x i32> @test_smull_high_s16_splata1(<2 x i64> %aa, <8 x i16> %b) #0 {
; CHECK-LE-LABEL: test_smull_high_s16_splata1:
; CHECK-LE: // %bb.0: // %entry
-; CHECK-LE-NEXT: dup v0.8h, v0.h[3]
-; CHECK-LE-NEXT: smull2 v0.4s, v0.8h, v1.8h
+; CHECK-LE-NEXT: smull2 v0.4s, v1.8h, v0.h[3]
; CHECK-LE-NEXT: ret
;
; CHECK-BE-LABEL: test_smull_high_s16_splata1:
; CHECK-BE: // %bb.0: // %entry
-; CHECK-BE-NEXT: rev64 v0.8h, v0.8h
; CHECK-BE-NEXT: rev64 v1.8h, v1.8h
-; CHECK-BE-NEXT: ext v0.16b, v0.16b, v0.16b, #8
+; CHECK-BE-NEXT: rev64 v0.8h, v0.8h
; CHECK-BE-NEXT: ext v1.16b, v1.16b, v1.16b, #8
-; CHECK-BE-NEXT: dup v0.8h, v0.h[3]
-; CHECK-BE-NEXT: smull2 v0.4s, v0.8h, v1.8h
+; CHECK-BE-NEXT: ext v0.16b, v0.16b, v0.16b, #8
+; CHECK-BE-NEXT: smull2 v0.4s, v1.8h, v0.h[3]
; CHECK-BE-NEXT: rev64 v0.4s, v0.4s
; CHECK-BE-NEXT: ext v0.16b, v0.16b, v0.16b, #8
; CHECK-BE-NEXT: ret
@@ -570,18 +568,16 @@ define <2 x i64> @hadd32_zext_asr(<16 x i8> %src1a) {
define <2 x i64> @test_umull_high_s16_splata1(<2 x i64> %aa, <4 x i32> %b) #0 {
; CHECK-LE-LABEL: test_umull_high_s16_splata1:
; CHECK-LE: // %bb.0: // %entry
-; CHECK-LE-NEXT: dup v0.4s, v0.s[1]
-; CHECK-LE-NEXT: umull2 v0.2d, v0.4s, v1.4s
+; CHECK-LE-NEXT: umull2 v0.2d, v1.4s, v0.s[1]
; CHECK-LE-NEXT: ret
;
; CHECK-BE-LABEL: test_umull_high_s16_splata1:
; CHECK-BE: // %bb.0: // %entry
-; CHECK-BE-NEXT: rev64 v0.4s, v0.4s
; CHECK-BE-NEXT: rev64 v1.4s, v1.4s
-; CHECK-BE-NEXT: ext v0.16b, v0.16b, v0.16b, #8
+; CHECK-BE-NEXT: rev64 v0.4s, v0.4s
; CHECK-BE-NEXT: ext v1.16b, v1.16b, v1.16b, #8
-; CHECK-BE-NEXT: dup v0.4s, v0.s[1]
-; CHECK-BE-NEXT: umull2 v0.2d, v0.4s, v1.4s
+; CHECK-BE-NEXT: ext v0.16b, v0.16b, v0.16b, #8
+; CHECK-BE-NEXT: umull2 v0.2d, v1.4s, v0.s[1]
; CHECK-BE-NEXT: ext v0.16b, v0.16b, v0.16b, #8
; CHECK-BE-NEXT: ret
entry:
More information about the llvm-commits
mailing list