mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[IR] Refactor attribute methods in Function class (NFC)
Rename the functions that query the optimization kind attributes. Differential revision: https://reviews.llvm.org/D60287 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -897,7 +897,7 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) {
|
||||
|
||||
// Use the OptMinSizeThreshold or OptSizeThreshold knob if they are available
|
||||
// and reduce the threshold if the caller has the necessary attribute.
|
||||
if (Caller->optForMinSize()) {
|
||||
if (Caller->hasMinSize()) {
|
||||
Threshold = MinIfValid(Threshold, Params.OptMinSizeThreshold);
|
||||
// For minsize, we want to disable the single BB bonus and the vector
|
||||
// bonuses, but not the last-call-to-static bonus. Inlining the last call to
|
||||
@@ -905,12 +905,12 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) {
|
||||
// call/return instructions.
|
||||
SingleBBBonusPercent = 0;
|
||||
VectorBonusPercent = 0;
|
||||
} else if (Caller->optForSize())
|
||||
} else if (Caller->hasOptSize())
|
||||
Threshold = MinIfValid(Threshold, Params.OptSizeThreshold);
|
||||
|
||||
// Adjust the threshold based on inlinehint attribute and profile based
|
||||
// hotness information if the caller does not have MinSize attribute.
|
||||
if (!Caller->optForMinSize()) {
|
||||
if (!Caller->hasMinSize()) {
|
||||
if (Callee.hasFnAttribute(Attribute::InlineHint))
|
||||
Threshold = MaxIfValid(Threshold, Params.HintThreshold);
|
||||
|
||||
@@ -923,7 +923,7 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) {
|
||||
// BlockFrequencyInfo is available.
|
||||
BlockFrequencyInfo *CallerBFI = GetBFI ? &((*GetBFI)(*Caller)) : nullptr;
|
||||
auto HotCallSiteThreshold = getHotCallSiteThreshold(CS, CallerBFI);
|
||||
if (!Caller->optForSize() && HotCallSiteThreshold) {
|
||||
if (!Caller->hasOptSize() && HotCallSiteThreshold) {
|
||||
LLVM_DEBUG(dbgs() << "Hot callsite.\n");
|
||||
// FIXME: This should update the threshold only if it exceeds the
|
||||
// current threshold, but AutoFDO + ThinLTO currently relies on this
|
||||
@@ -1899,7 +1899,7 @@ InlineResult CallAnalyzer::analyzeCall(CallSite CS) {
|
||||
// size, we penalise any call sites that perform loops. We do this after all
|
||||
// other costs here, so will likely only be dealing with relatively small
|
||||
// functions (and hence DT and LI will hopefully be cheap).
|
||||
if (Caller->optForMinSize()) {
|
||||
if (Caller->hasMinSize()) {
|
||||
DominatorTree DT(F);
|
||||
LoopInfo LI(DT);
|
||||
int NumLoops = 0;
|
||||
@@ -2036,7 +2036,7 @@ InlineCost llvm::getInlineCost(
|
||||
return llvm::InlineCost::getNever("conflicting attributes");
|
||||
|
||||
// Don't inline this call if the caller has the optnone attribute.
|
||||
if (Caller->optForNone())
|
||||
if (Caller->hasOptNone())
|
||||
return llvm::InlineCost::getNever("optnone attribute");
|
||||
|
||||
// Don't inline a function that treats null pointer as valid into a caller
|
||||
|
||||
Reference in New Issue
Block a user