diff --git a/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td b/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td --- a/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td +++ b/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td @@ -151,6 +151,7 @@ def : GINodeEquiv; def : GINodeEquiv; def : GINodeEquiv; +def : GINodeEquiv; def : GINodeEquiv; def : GINodeEquiv; diff --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp --- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp +++ b/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; } diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir b/llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir --- a/llvm/test/CodeGen/AArch64/GlobalISel/select-reduce-fadd.mir +++ b/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)