diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -809,7 +809,7 @@ /// 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. @@ -1510,7 +1510,7 @@ 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, @@ -1929,7 +1929,9 @@ 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 { diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h --- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -337,7 +337,7 @@ bool isFCmpOrdCheaperThanFCmpZero(Type *Ty) const { return true; } - unsigned getFPOpCost(Type *Ty) const { + InstructionCost getFPOpCost(Type *Ty) const { return TargetTransformInfo::TCC_Basic; } diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -390,7 +390,7 @@ 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(); diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -526,8 +526,8 @@ 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; }