[llvm] r260653 - [attrs] Run clang-format over a newly added routine in function-attrs
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 11 19:07:50 PST 2016
Author: chandlerc
Date: Thu Feb 11 21:07:50 2016
New Revision: 260653
URL: http://llvm.org/viewvc/llvm-project?rev=260653&view=rev
Log:
[attrs] Run clang-format over a newly added routine in function-attrs
before I update it to be friendly with the new pass manager.
Modified:
llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp
Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=260653&r1=260652&r2=260653&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Thu Feb 11 21:07:50 2016
@@ -943,21 +943,24 @@ static bool removeConvergentAttrs(const
// Determines whether a function can be made non-convergent, ignoring all
// other functions in SCC. (A function can *actually* be made non-convergent
// only if all functions in its SCC can be made convergent.)
- auto CanRemoveConvergent = [&] (CallGraphNode *CGN) {
+ auto CanRemoveConvergent = [&](CallGraphNode *CGN) {
Function *F = CGN->getFunction();
- if (!F) return false;
+ if (!F)
+ return false;
- if (!F->isConvergent()) return true;
+ if (!F->isConvergent())
+ return true;
// Can't remove convergent from declarations.
- if (F->isDeclaration()) return false;
+ if (F->isDeclaration())
+ return false;
// Don't remove convergent from optnone functions.
if (F->hasFnAttribute(Attribute::OptimizeNone))
return false;
- // Can't remove convergent if any of F's callees -- ignoring functions in the
- // SCC itself -- are convergent.
+ // Can't remove convergent if any of F's callees -- ignoring functions in
+ // the SCC itself -- are convergent.
if (llvm::any_of(*CGN, [&](const CallGraphNode::CallRecord &CR) {
Function *F = CR.second->getFunction();
return SCCNodes.count(F) == 0 && (!F || F->isConvergent());
@@ -965,8 +968,8 @@ static bool removeConvergentAttrs(const
return false;
// CGN doesn't contain calls to intrinsics, so iterate over all of F's
- // callsites, looking for any calls to convergent intrinsics. If we find one,
- // F must remain marked as convergent.
+ // callsites, looking for any calls to convergent intrinsics. If we find
+ // one, F must remain marked as convergent.
auto IsConvergentIntrinsicCall = [](Instruction &I) {
CallSite CS(cast<Value>(&I));
if (!CS)
@@ -979,10 +982,11 @@ static bool removeConvergentAttrs(const
});
};
- // We can remove the convergent attr from functions in the SCC if they all can
- // be made non-convergent (because they call only non-convergent functions,
- // other than each other).
- if (!llvm::all_of(SCC, CanRemoveConvergent)) return false;
+ // We can remove the convergent attr from functions in the SCC if they all
+ // can be made non-convergent (because they call only non-convergent
+ // functions, other than each other).
+ if (!llvm::all_of(SCC, CanRemoveConvergent))
+ return false;
// If we got here, all of the SCC's callees are non-convergent, and none of
// the optnone functions in the SCC are marked as convergent. Therefore all
More information about the llvm-commits
mailing list