[PATCH] D153244: [AArch64] Remove G_VECREDUCE_FADD from selectReduction
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 22 04:47:11 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG68a09c929003: [AArch64] Remove G_VECREDUCE_FADD from selectReduction (authored by dmgreen).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153244/new/
https://reviews.llvm.org/D153244
Files:
llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir
Index: llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir
===================================================================
--- llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir
+++ llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir
@@ -11,10 +11,11 @@
; CHECK-LABEL: name: fadd_v2s32
; CHECK: liveins: $d0
- ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
- ; CHECK: [[FADDPv2i32p:%[0-9]+]]:fpr32 = FADDPv2i32p [[COPY]]
- ; CHECK: $w0 = COPY [[FADDPv2i32p]]
- ; CHECK: RET_ReallyLR implicit $w0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
+ ; CHECK-NEXT: [[FADDPv2i32p:%[0-9]+]]:fpr32 = nofpexcept FADDPv2i32p [[COPY]], implicit $fpcr
+ ; CHECK-NEXT: $w0 = COPY [[FADDPv2i32p]]
+ ; CHECK-NEXT: RET_ReallyLR implicit $w0
%0:fpr(<2 x s32>) = COPY $d0
%1:fpr(s32) = G_VECREDUCE_FADD %0(<2 x s32>)
$w0 = COPY %1(s32)
@@ -32,10 +33,11 @@
; CHECK-LABEL: name: fadd_v2s64
; CHECK: liveins: $q0
- ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
- ; CHECK: [[FADDPv2i64p:%[0-9]+]]:fpr64 = FADDPv2i64p [[COPY]]
- ; CHECK: $x0 = COPY [[FADDPv2i64p]]
- ; CHECK: RET_ReallyLR implicit $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
+ ; CHECK-NEXT: [[FADDPv2i64p:%[0-9]+]]:fpr64 = nofpexcept FADDPv2i64p [[COPY]], implicit $fpcr
+ ; CHECK-NEXT: $x0 = COPY [[FADDPv2i64p]]
+ ; CHECK-NEXT: RET_ReallyLR implicit $x0
%0:fpr(<2 x s64>) = COPY $q0
%2:fpr(s64) = G_VECREDUCE_FADD %0(<2 x s64>)
$x0 = COPY %2(s64)
Index: llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
===================================================================
--- llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -3509,7 +3509,6 @@
return selectConcatVectors(I, MRI);
case TargetOpcode::G_JUMP_TABLE:
return selectJumpTable(I, MRI);
- case TargetOpcode::G_VECREDUCE_FADD:
case TargetOpcode::G_VECREDUCE_ADD:
return selectReduction(I, MRI);
case TargetOpcode::G_MEMCPY:
@@ -3559,19 +3558,6 @@
return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
}
- if (I.getOpcode() == TargetOpcode::G_VECREDUCE_FADD) {
- unsigned Opc = 0;
- if (VecTy == LLT::fixed_vector(2, 32))
- Opc = AArch64::FADDPv2i32p;
- else if (VecTy == LLT::fixed_vector(2, 64))
- Opc = AArch64::FADDPv2i64p;
- else {
- LLVM_DEBUG(dbgs() << "Unhandled type for fadd reduction");
- return false;
- }
- I.setDesc(TII.get(Opc));
- return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
- }
return false;
}
Index: llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
===================================================================
--- llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
+++ llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
@@ -151,6 +151,7 @@
def : GINodeEquiv<G_ROTL, rotl>;
def : GINodeEquiv<G_LROUND, lround>;
def : GINodeEquiv<G_LLROUND, llround>;
+def : GINodeEquiv<G_VECREDUCE_FADD, vecreduce_fadd>;
def : GINodeEquiv<G_STRICT_FADD, strict_fadd>;
def : GINodeEquiv<G_STRICT_FSUB, strict_fsub>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153244.533560.patch
Type: text/x-patch
Size: 3241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230622/878d8ba0/attachment.bin>
More information about the llvm-commits
mailing list