forked from OSchip/llvm-project
Use early continue to reduce indentation.
llvm-svn: 256272
This commit is contained in:
parent
e4ed0e56ce
commit
9f0bebc3da
|
@ -2030,26 +2030,28 @@ bool GlobalOpt::OptimizeFunctions(Module &M) {
|
||||||
F->eraseFromParent();
|
F->eraseFromParent();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
++NumFnDeleted;
|
++NumFnDeleted;
|
||||||
} else if (F->hasLocalLinkage()) {
|
continue;
|
||||||
if (isProfitableToMakeFastCC(F) && !F->isVarArg() &&
|
}
|
||||||
!F->hasAddressTaken()) {
|
if (!F->hasLocalLinkage())
|
||||||
// If this function has a calling convention worth changing, is not a
|
continue;
|
||||||
// varargs function, and is only called directly, promote it to use the
|
if (isProfitableToMakeFastCC(F) && !F->isVarArg() &&
|
||||||
// Fast calling convention.
|
!F->hasAddressTaken()) {
|
||||||
F->setCallingConv(CallingConv::Fast);
|
// If this function has a calling convention worth changing, is not a
|
||||||
ChangeCalleesToFastCall(F);
|
// varargs function, and is only called directly, promote it to use the
|
||||||
++NumFastCallFns;
|
// Fast calling convention.
|
||||||
Changed = true;
|
F->setCallingConv(CallingConv::Fast);
|
||||||
}
|
ChangeCalleesToFastCall(F);
|
||||||
|
++NumFastCallFns;
|
||||||
|
Changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (F->getAttributes().hasAttrSomewhere(Attribute::Nest) &&
|
if (F->getAttributes().hasAttrSomewhere(Attribute::Nest) &&
|
||||||
!F->hasAddressTaken()) {
|
!F->hasAddressTaken()) {
|
||||||
// The function is not used by a trampoline intrinsic, so it is safe
|
// The function is not used by a trampoline intrinsic, so it is safe
|
||||||
// to remove the 'nest' attribute.
|
// to remove the 'nest' attribute.
|
||||||
RemoveNestAttribute(F);
|
RemoveNestAttribute(F);
|
||||||
++NumNestRemoved;
|
++NumNestRemoved;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Changed;
|
return Changed;
|
||||||
|
|
Loading…
Reference in New Issue