[FunctionAttrs] Inline setDoesNotRecurse() and delete it. NFC

It always returns true, which may lead to confusion. Inline it because it is
trivial and only called twice.
This commit is contained in:
Fangrui Song 2020-09-19 22:24:51 -07:00
parent 0526713aa8
commit 871d03a675
1 changed files with 6 additions and 8 deletions

View File

@ -1345,12 +1345,6 @@ static bool inferAttrsFromFunctionBodies(const SCCNodeSet &SCCNodes) {
return AI.run(SCCNodes);
}
static bool setDoesNotRecurse(Function &F) {
F.setDoesNotRecurse();
++NumNoRecurse;
return true;
}
static bool addNoRecurseAttrs(const SCCNodeSet &SCCNodes) {
// Try and identify functions that do not recurse.
@ -1377,7 +1371,9 @@ static bool addNoRecurseAttrs(const SCCNodeSet &SCCNodes) {
// Every call was to a non-recursive function other than this function, and
// we have no indirect recursion as the SCC size is one. This function cannot
// recurse.
return setDoesNotRecurse(*F);
F->setDoesNotRecurse();
++NumNoRecurse;
return true;
}
template <typename AARGetterT>
@ -1580,7 +1576,9 @@ static bool addNoRecurseAttrsTopDown(Function &F) {
if (!CB || !CB->getParent()->getParent()->doesNotRecurse())
return false;
}
return setDoesNotRecurse(F);
F.setDoesNotRecurse();
++NumNoRecurse;
return true;
}
static bool deduceFunctionAttributeInRPO(Module &M, CallGraph &CG) {