diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-22 19:26:18 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-22 19:26:18 +0000 |
commit | 9f0bebc3dab3d2541e9f2342a4658d08fc8d1bd8 (patch) | |
tree | 0ba25136f9fc931396c41cdde7a5fd2b3b4f754d /llvm | |
parent | e4ed0e56ce6de83a8c88f2795fc8765e7a0d74d5 (diff) | |
download | bcm5719-llvm-9f0bebc3dab3d2541e9f2342a4658d08fc8d1bd8.tar.gz bcm5719-llvm-9f0bebc3dab3d2541e9f2342a4658d08fc8d1bd8.zip |
Use early continue to reduce indentation.
llvm-svn: 256272
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 4299f0c56f7..668b7d819ef 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -2030,26 +2030,28 @@ bool GlobalOpt::OptimizeFunctions(Module &M) { F->eraseFromParent(); Changed = true; ++NumFnDeleted; - } else if (F->hasLocalLinkage()) { - if (isProfitableToMakeFastCC(F) && !F->isVarArg() && - !F->hasAddressTaken()) { - // If this function has a calling convention worth changing, is not a - // varargs function, and is only called directly, promote it to use the - // Fast calling convention. - F->setCallingConv(CallingConv::Fast); - ChangeCalleesToFastCall(F); - ++NumFastCallFns; - Changed = true; - } + continue; + } + if (!F->hasLocalLinkage()) + continue; + if (isProfitableToMakeFastCC(F) && !F->isVarArg() && + !F->hasAddressTaken()) { + // If this function has a calling convention worth changing, is not a + // varargs function, and is only called directly, promote it to use the + // Fast calling convention. + F->setCallingConv(CallingConv::Fast); + ChangeCalleesToFastCall(F); + ++NumFastCallFns; + Changed = true; + } - if (F->getAttributes().hasAttrSomewhere(Attribute::Nest) && - !F->hasAddressTaken()) { - // The function is not used by a trampoline intrinsic, so it is safe - // to remove the 'nest' attribute. - RemoveNestAttribute(F); - ++NumNestRemoved; - Changed = true; - } + if (F->getAttributes().hasAttrSomewhere(Attribute::Nest) && + !F->hasAddressTaken()) { + // The function is not used by a trampoline intrinsic, so it is safe + // to remove the 'nest' attribute. + RemoveNestAttribute(F); + ++NumNestRemoved; + Changed = true; } } return Changed; |