mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
[TTI] NFC: Change getMemcpyCost 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 Differential Revision: https://reviews.llvm.org/D100563
This commit is contained in:
parent
9eda3a0c2e
commit
a6cde052ae
@ -293,7 +293,7 @@ public:
|
||||
|
||||
/// \return the expected cost of a memcpy, which could e.g. depend on the
|
||||
/// source/destination type and alignment and the number of bytes copied.
|
||||
int getMemcpyCost(const Instruction *I) const;
|
||||
InstructionCost getMemcpyCost(const Instruction *I) const;
|
||||
|
||||
/// \return The estimated number of case clusters when lowering \p 'SI'.
|
||||
/// \p JTSize Set a jump table size only when \p SI is suitable for a jump
|
||||
@ -1408,7 +1408,7 @@ public:
|
||||
virtual unsigned getInliningThresholdMultiplier() = 0;
|
||||
virtual unsigned adjustInliningThreshold(const CallBase *CB) = 0;
|
||||
virtual int getInlinerVectorBonusPercent() = 0;
|
||||
virtual int getMemcpyCost(const Instruction *I) = 0;
|
||||
virtual InstructionCost getMemcpyCost(const Instruction *I) = 0;
|
||||
virtual unsigned
|
||||
getEstimatedNumberOfCaseClusters(const SwitchInst &SI, unsigned &JTSize,
|
||||
ProfileSummaryInfo *PSI,
|
||||
@ -1709,7 +1709,7 @@ public:
|
||||
int getInlinerVectorBonusPercent() override {
|
||||
return Impl.getInlinerVectorBonusPercent();
|
||||
}
|
||||
int getMemcpyCost(const Instruction *I) override {
|
||||
InstructionCost getMemcpyCost(const Instruction *I) override {
|
||||
return Impl.getMemcpyCost(I);
|
||||
}
|
||||
InstructionCost getUserCost(const User *U, ArrayRef<const Value *> Operands,
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
|
||||
int getInlinerVectorBonusPercent() const { return 150; }
|
||||
|
||||
unsigned getMemcpyCost(const Instruction *I) const {
|
||||
InstructionCost getMemcpyCost(const Instruction *I) const {
|
||||
return TTI::TCC_Expensive;
|
||||
}
|
||||
|
||||
|
@ -885,8 +885,8 @@ TargetTransformInfo::getAddressComputationCost(Type *Tp, ScalarEvolution *SE,
|
||||
return Cost;
|
||||
}
|
||||
|
||||
int TargetTransformInfo::getMemcpyCost(const Instruction *I) const {
|
||||
int Cost = TTIImpl->getMemcpyCost(I);
|
||||
InstructionCost TargetTransformInfo::getMemcpyCost(const Instruction *I) const {
|
||||
InstructionCost Cost = TTIImpl->getMemcpyCost(I);
|
||||
assert(Cost >= 0 && "TTI should not produce negative costs!");
|
||||
return Cost;
|
||||
}
|
||||
|
@ -1126,7 +1126,7 @@ int ARMTTIImpl::getNumMemOps(const IntrinsicInst *I) const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ARMTTIImpl::getMemcpyCost(const Instruction *I) {
|
||||
InstructionCost ARMTTIImpl::getMemcpyCost(const Instruction *I) {
|
||||
int NumOps = getNumMemOps(cast<IntrinsicInst>(I));
|
||||
|
||||
// To model the cost of a library call, we assume 1 for the call, and
|
||||
|
@ -183,7 +183,7 @@ public:
|
||||
return isLegalMaskedGather(Ty, Alignment);
|
||||
}
|
||||
|
||||
int getMemcpyCost(const Instruction *I);
|
||||
InstructionCost getMemcpyCost(const Instruction *I);
|
||||
|
||||
int getNumMemOps(const IntrinsicInst *I) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user