[PATCH] D145064: [DAG] ABD is not reassociative
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 1 08:22:29 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG337215ddf93f: [DAG] ABD is not reassociative (authored by dmgreen).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145064/new/
https://reviews.llvm.org/D145064
Files:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/abd-combine.ll
Index: llvm/test/CodeGen/AArch64/abd-combine.ll
===================================================================
--- llvm/test/CodeGen/AArch64/abd-combine.ll
+++ llvm/test/CodeGen/AArch64/abd-combine.ll
@@ -321,8 +321,10 @@
define <8 x i16> @abdu_i_reassoc(<8 x i16> %src1) {
; CHECK-LABEL: abdu_i_reassoc:
; CHECK: // %bb.0:
-; CHECK-NEXT: movi v1.8h, #2
+; CHECK-NEXT: movi v1.8h, #3
+; CHECK-NEXT: movi v2.8h, #1
; CHECK-NEXT: uabd v0.8h, v0.8h, v1.8h
+; CHECK-NEXT: uabd v0.8h, v0.8h, v2.8h
; CHECK-NEXT: ret
%r1 = call <8 x i16> @llvm.aarch64.neon.uabd.v8i16(<8 x i16> %src1, <8 x i16> <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>)
%result = call <8 x i16> @llvm.aarch64.neon.uabd.v8i16(<8 x i16> %r1, <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>)
@@ -539,8 +541,10 @@
define <8 x i16> @abds_i_reassoc(<8 x i16> %src1) {
; CHECK-LABEL: abds_i_reassoc:
; CHECK: // %bb.0:
-; CHECK-NEXT: movi v1.8h, #2
+; CHECK-NEXT: movi v1.8h, #3
+; CHECK-NEXT: movi v2.8h, #1
; CHECK-NEXT: sabd v0.8h, v0.8h, v1.8h
+; CHECK-NEXT: sabd v0.8h, v0.8h, v2.8h
; CHECK-NEXT: ret
%r1 = call <8 x i16> @llvm.aarch64.neon.sabd.v8i16(<8 x i16> %src1, <8 x i16> <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>)
%result = call <8 x i16> @llvm.aarch64.neon.sabd.v8i16(<8 x i16> %r1, <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>)
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -5073,9 +5073,6 @@
// fold (abd c1, c2)
if (SDValue C = DAG.FoldConstantArithmetic(Opcode, DL, VT, {N0, N1}))
return C;
- // reassociate if possible
- if (SDValue C = reassociateOps(Opcode, DL, N0, N1, N->getFlags()))
- return C;
// canonicalize constant to RHS.
if (DAG.isConstantIntBuildVectorOrConstantInt(N0) &&
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145064.501524.patch
Type: text/x-patch
Size: 2008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230301/2ba0545c/attachment.bin>
More information about the llvm-commits
mailing list