Index: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -141,6 +141,7 @@ R = SoftenFloatRes_VECREDUCE(N); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: R = SoftenFloatRes_VECREDUCE_SEQ(N); break; } @@ -2261,6 +2262,7 @@ R = PromoteFloatRes_VECREDUCE(N); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: R = PromoteFloatRes_VECREDUCE_SEQ(N); break; } @@ -2623,6 +2625,7 @@ R = SoftPromoteHalfRes_VECREDUCE(N); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: R = SoftPromoteHalfRes_VECREDUCE_SEQ(N); break; } Index: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -490,6 +490,7 @@ Node->getOperand(0).getValueType()); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: Action = TLI.getOperationAction(Node->getOpcode(), Node->getOperand(1).getValueType()); break; @@ -875,6 +876,7 @@ Results.push_back(TLI.expandVecReduce(Node, DAG)); return; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: Results.push_back(TLI.expandVecReduceSeq(Node, DAG)); return; case ISD::SREM: Index: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -624,6 +624,7 @@ Res = ScalarizeVecOp_VECREDUCE(N); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: Res = ScalarizeVecOp_VECREDUCE_SEQ(N); break; } @@ -2090,6 +2091,7 @@ Res = SplitVecOp_VECREDUCE(N, OpNo); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: Res = SplitVecOp_VECREDUCE_SEQ(N); break; } @@ -4358,6 +4360,7 @@ Res = WidenVecOp_VECREDUCE(N); break; case ISD::VECREDUCE_SEQ_FADD: + case ISD::VECREDUCE_SEQ_FMUL: Res = WidenVecOp_VECREDUCE_SEQ(N); break; } Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -341,6 +341,7 @@ case ISD::VECREDUCE_SEQ_FADD: return ISD::FADD; case ISD::VECREDUCE_FMUL: + case ISD::VECREDUCE_SEQ_FMUL: return ISD::FMUL; case ISD::VECREDUCE_ADD: return ISD::ADD; Index: llvm/lib/CodeGen/TargetLoweringBase.cpp =================================================================== --- llvm/lib/CodeGen/TargetLoweringBase.cpp +++ llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -734,6 +734,7 @@ setOperationAction(ISD::VECREDUCE_FMAX, VT, Expand); setOperationAction(ISD::VECREDUCE_FMIN, VT, Expand); setOperationAction(ISD::VECREDUCE_SEQ_FADD, VT, Expand); + setOperationAction(ISD::VECREDUCE_SEQ_FMUL, VT, Expand); } // Most targets ignore the @llvm.prefetch intrinsic. Index: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h =================================================================== --- llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h +++ llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h @@ -221,17 +221,7 @@ shouldConsiderAddressTypePromotion(const Instruction &I, bool &AllowPromotionWithoutCommonHeader); - bool shouldExpandReduction(const IntrinsicInst *II) const { - switch (II->getIntrinsicID()) { - case Intrinsic::vector_reduce_fmul: - // We don't have legalization support for ordered FMUL reductions. - return !II->getFastMathFlags().allowReassoc(); - - default: - // Don't expand anything else, let legalization deal with it. - return false; - } - } + bool shouldExpandReduction(const IntrinsicInst *II) const { return false; } unsigned getGISelRematGlobalCost() const { return 2; Index: llvm/lib/Target/ARM/ARMTargetTransformInfo.h =================================================================== --- llvm/lib/Target/ARM/ARMTargetTransformInfo.h +++ llvm/lib/Target/ARM/ARMTargetTransformInfo.h @@ -193,16 +193,7 @@ bool preferPredicatedReductionSelect(unsigned Opcode, Type *Ty, TTI::ReductionFlags Flags) const; - bool shouldExpandReduction(const IntrinsicInst *II) const { - switch (II->getIntrinsicID()) { - case Intrinsic::vector_reduce_fmul: - // We don't have legalization support for ordered FMUL reductions. - return !II->getFastMathFlags().allowReassoc(); - default: - // Don't expand anything else, let legalization deal with it. - return false; - } - } + bool shouldExpandReduction(const IntrinsicInst *II) const { return false; } int getCFInstrCost(unsigned Opcode, TTI::TargetCostKind CostKind);