forked from OSchip/llvm-project
[TTI] NFC: Change getFPOpCost to return InstructionCost
This patch migrates the TTI cost interfaces to return an InstructionCost. See this patch for the introduction of the type: https://reviews.llvm.org/D91174 See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html Reviewed By: c-rhodes Differential Revision: https://reviews.llvm.org/D100316
This commit is contained in:
parent
1af35e77f4
commit
d84bd951a8
|
@ -812,7 +812,7 @@ public:
|
|||
|
||||
/// Return the expected cost of supporting the floating point operation
|
||||
/// of the specified type.
|
||||
int getFPOpCost(Type *Ty) const;
|
||||
InstructionCost getFPOpCost(Type *Ty) const;
|
||||
|
||||
/// Return the expected cost of materializing for the given integer
|
||||
/// immediate of the specified type.
|
||||
|
@ -1515,7 +1515,7 @@ public:
|
|||
virtual PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) = 0;
|
||||
virtual bool haveFastSqrt(Type *Ty) = 0;
|
||||
virtual bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) = 0;
|
||||
virtual int getFPOpCost(Type *Ty) = 0;
|
||||
virtual InstructionCost getFPOpCost(Type *Ty) = 0;
|
||||
virtual int getIntImmCodeSizeCost(unsigned Opc, unsigned Idx,
|
||||
const APInt &Imm, Type *Ty) = 0;
|
||||
virtual int getIntImmCost(const APInt &Imm, Type *Ty,
|
||||
|
@ -1938,7 +1938,9 @@ public:
|
|||
return Impl.isFCmpOrdCheaperThanFCmpZero(Ty);
|
||||
}
|
||||
|
||||
int getFPOpCost(Type *Ty) override { return Impl.getFPOpCost(Ty); }
|
||||
InstructionCost getFPOpCost(Type *Ty) override {
|
||||
return Impl.getFPOpCost(Ty);
|
||||
}
|
||||
|
||||
int getIntImmCodeSizeCost(unsigned Opc, unsigned Idx, const APInt &Imm,
|
||||
Type *Ty) override {
|
||||
|
|
|
@ -340,7 +340,7 @@ public:
|
|||
|
||||
bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) const { return true; }
|
||||
|
||||
unsigned getFPOpCost(Type *Ty) const {
|
||||
InstructionCost getFPOpCost(Type *Ty) const {
|
||||
return TargetTransformInfo::TCC_Basic;
|
||||
}
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
unsigned getFPOpCost(Type *Ty) {
|
||||
InstructionCost getFPOpCost(Type *Ty) {
|
||||
// Check whether FADD is available, as a proxy for floating-point in
|
||||
// general.
|
||||
const TargetLoweringBase *TLI = getTLI();
|
||||
|
|
|
@ -531,8 +531,8 @@ bool TargetTransformInfo::isFCmpOrdCheaperThanFCmpZero(Type *Ty) const {
|
|||
return TTIImpl->isFCmpOrdCheaperThanFCmpZero(Ty);
|
||||
}
|
||||
|
||||
int TargetTransformInfo::getFPOpCost(Type *Ty) const {
|
||||
int Cost = TTIImpl->getFPOpCost(Ty);
|
||||
InstructionCost TargetTransformInfo::getFPOpCost(Type *Ty) const {
|
||||
InstructionCost Cost = TTIImpl->getFPOpCost(Ty);
|
||||
assert(Cost >= 0 && "TTI should not produce negative costs!");
|
||||
return Cost;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue