[PATCH] D100563: [TTI] NFC: Change getMemcpyCost to return InstructionCost
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 23 08:07:50 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG008a072ded63: [TTI] NFC: Change getMemcpyCost to return InstructionCost (authored by sdesmalen).
Herald added a subscriber: tmatheson.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100563/new/
https://reviews.llvm.org/D100563
Files:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/lib/Target/ARM/ARMTargetTransformInfo.h
Index: llvm/lib/Target/ARM/ARMTargetTransformInfo.h
===================================================================
--- llvm/lib/Target/ARM/ARMTargetTransformInfo.h
+++ llvm/lib/Target/ARM/ARMTargetTransformInfo.h
@@ -183,7 +183,7 @@
return isLegalMaskedGather(Ty, Alignment);
}
- int getMemcpyCost(const Instruction *I);
+ InstructionCost getMemcpyCost(const Instruction *I);
int getNumMemOps(const IntrinsicInst *I) const;
Index: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
+++ llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
@@ -1126,7 +1126,7 @@
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
Index: llvm/lib/Analysis/TargetTransformInfo.cpp
===================================================================
--- llvm/lib/Analysis/TargetTransformInfo.cpp
+++ llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -885,8 +885,8 @@
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;
}
Index: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
===================================================================
--- llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -75,7 +75,7 @@
int getInlinerVectorBonusPercent() const { return 150; }
- unsigned getMemcpyCost(const Instruction *I) const {
+ InstructionCost getMemcpyCost(const Instruction *I) const {
return TTI::TCC_Expensive;
}
Index: llvm/include/llvm/Analysis/TargetTransformInfo.h
===================================================================
--- llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -293,7 +293,7 @@
/// \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 @@
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 @@
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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100563.340042.patch
Type: text/x-patch
Size: 3547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210423/45842a0f/attachment.bin>
More information about the llvm-commits
mailing list