Fix buildbot failure by explicitly disabling partial reductions in TTI. (#190165)
Partial reductions were previously disabled by default, but by implementing a generic cost-model in BasicTTIImpl (#189905) this now accidentally enables the use of those when vectorising loops for targets that may not support this yet.
This commit is contained in:
parent
1484e0f16a
commit
62bbe3fffc
@ -66,6 +66,15 @@ public:
|
||||
unsigned Index, const Value *Op0, const Value *Op1,
|
||||
TTI::VectorInstrContext VIC =
|
||||
TTI::VectorInstrContext::None) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
@ -39,6 +39,15 @@ public:
|
||||
unsigned ScalarOpdIdx) const override;
|
||||
bool isTargetIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID,
|
||||
int OpdIdx) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
};
|
||||
} // namespace llvm
|
||||
|
||||
|
||||
@ -169,6 +169,15 @@ public:
|
||||
bool forceScalarizeMaskedScatter(VectorType *VTy,
|
||||
Align Alignment) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
|
||||
/// @}
|
||||
|
||||
InstructionCost
|
||||
|
||||
@ -57,6 +57,15 @@ public:
|
||||
|
||||
TTI::MemCmpExpansionOptions
|
||||
enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
@ -36,6 +36,15 @@ public:
|
||||
|
||||
bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1,
|
||||
const TargetTransformInfo::LSRCost &C2) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
@ -222,6 +222,15 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
|
||||
ValueUniformity getValueUniformity(const Value *V) const override;
|
||||
};
|
||||
|
||||
|
||||
@ -169,6 +169,15 @@ public:
|
||||
getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA,
|
||||
TTI::TargetCostKind CostKind) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
|
||||
private:
|
||||
// The following constant is used for estimating costs on power9.
|
||||
static const InstructionCost::CostType P9PipelineFlushEstimate = 80;
|
||||
|
||||
@ -64,6 +64,15 @@ public:
|
||||
|
||||
bool isLegalMaskedGather(Type *DataType, Align Alignment) const override;
|
||||
bool isLegalMaskedScatter(Type *DataType, Align Alignment) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
@ -51,6 +51,15 @@ public:
|
||||
Type *Ty = nullptr) const override;
|
||||
TypeSize
|
||||
getRegisterBitWidth(TargetTransformInfo::RegisterKind K) const override;
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF, TTI::PartialReductionExtendKind OpAExtend,
|
||||
TTI::PartialReductionExtendKind OpBExtend, std::optional<unsigned> BinOp,
|
||||
TTI::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
/// @}
|
||||
};
|
||||
|
||||
|
||||
@ -157,6 +157,17 @@ public:
|
||||
return true;
|
||||
return !isSupportedReduction(II->getIntrinsicID());
|
||||
}
|
||||
|
||||
InstructionCost getPartialReductionCost(
|
||||
unsigned Opcode, Type *InputTypeA, Type *InputTypeB, Type *AccumType,
|
||||
ElementCount VF,
|
||||
TargetTransformInfo::PartialReductionExtendKind OpAExtend,
|
||||
TargetTransformInfo::PartialReductionExtendKind OpBExtend,
|
||||
std::optional<unsigned> BinOp,
|
||||
TargetTransformInfo::TargetCostKind CostKind,
|
||||
std::optional<FastMathFlags> FMF) const override {
|
||||
return InstructionCost::getInvalid();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user