1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[LSR] fix typo in comments and rename for a new added hook.

This commit is contained in:
Chen Zheng 2020-10-26 22:29:22 -04:00
parent 6c9c96836e
commit 5e80159219
7 changed files with 18 additions and 18 deletions

View File

@ -613,10 +613,10 @@ public:
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
TargetTransformInfo::LSRCost &C2) const;
/// Return true if LSR major cost is register number. Targets which implement
/// their own isLSRCostLess and unset register number as major cost should
/// return false, otherwise return true.
bool isRegNumMajorCostOfLSR() const;
/// Return true if LSR major cost is number of registers. Targets which
/// implement their own isLSRCostLess and unset number of registers as major
/// cost should return false, otherwise return true.
bool isNumRegsMajorCostOfLSR() const;
/// \returns true if LSR should not optimize a chain that includes \p I.
bool isProfitableLSRChainElement(Instruction *I) const;
@ -1415,7 +1415,7 @@ public:
Instruction *I) = 0;
virtual bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
TargetTransformInfo::LSRCost &C2) = 0;
virtual bool isRegNumMajorCostOfLSR() = 0;
virtual bool isNumRegsMajorCostOfLSR() = 0;
virtual bool isProfitableLSRChainElement(Instruction *I) = 0;
virtual bool canMacroFuseCmp() = 0;
virtual bool canSaveCmp(Loop *L, BranchInst **BI, ScalarEvolution *SE,
@ -1737,8 +1737,8 @@ public:
TargetTransformInfo::LSRCost &C2) override {
return Impl.isLSRCostLess(C1, C2);
}
bool isRegNumMajorCostOfLSR() override {
return Impl.isRegNumMajorCostOfLSR();
bool isNumRegsMajorCostOfLSR() override {
return Impl.isNumRegsMajorCostOfLSR();
}
bool isProfitableLSRChainElement(Instruction *I) override {
return Impl.isProfitableLSRChainElement(I);

View File

@ -192,7 +192,7 @@ public:
C2.ScaleCost, C2.ImmCost, C2.SetupCost);
}
bool isRegNumMajorCostOfLSR() { return true; }
bool isNumRegsMajorCostOfLSR() { return true; }
bool isProfitableLSRChainElement(Instruction *I) { return false; }

View File

@ -264,8 +264,8 @@ public:
return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
}
bool isRegNumMajorCostOfLSR() {
return TargetTransformInfoImplBase::isRegNumMajorCostOfLSR();
bool isNumRegsMajorCostOfLSR() {
return TargetTransformInfoImplBase::isNumRegsMajorCostOfLSR();
}
bool isProfitableLSRChainElement(Instruction *I) {

View File

@ -377,8 +377,8 @@ bool TargetTransformInfo::isLSRCostLess(LSRCost &C1, LSRCost &C2) const {
return TTIImpl->isLSRCostLess(C1, C2);
}
bool TargetTransformInfo::isRegNumMajorCostOfLSR() const {
return TTIImpl->isRegNumMajorCostOfLSR();
bool TargetTransformInfo::isNumRegsMajorCostOfLSR() const {
return TTIImpl->isNumRegsMajorCostOfLSR();
}
bool TargetTransformInfo::isProfitableLSRChainElement(Instruction *I) const {

View File

@ -1204,7 +1204,7 @@ bool PPCTTIImpl::isLSRCostLess(TargetTransformInfo::LSRCost &C1,
return TargetTransformInfoImplBase::isLSRCostLess(C1, C2);
}
bool PPCTTIImpl::isRegNumMajorCostOfLSR() {
bool PPCTTIImpl::isNumRegsMajorCostOfLSR() {
return false;
}

View File

@ -75,7 +75,7 @@ public:
TTI::PeelingPreferences &PP);
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1,
TargetTransformInfo::LSRCost &C2);
bool isRegNumMajorCostOfLSR();
bool isNumRegsMajorCostOfLSR();
/// @}

View File

@ -2866,11 +2866,11 @@ static bool isProfitableChain(IVChain &Chain,
if (TTI.isProfitableLSRChainElement(Inc.UserInst))
return true;
// If register number is the major cost, we cannot benefit from this
// profitable chain which is based on register number.
// If number of registers is not the major cost, we cannot benefit from this
// profitable chain which is based on number of registers.
// FIXME: add profitable chain optimization for other kinds major cost, for
// example instruction number.
if (!TTI.isRegNumMajorCostOfLSR())
// example number of instructions.
if (!TTI.isNumRegsMajorCostOfLSR())
return false;
for (const IVInc &Inc : Chain) {