diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-02-12 03:07:50 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-02-12 03:07:50 +0000 |
commit | bbbbec0b54c55d21404efc41450fbd5f9a96029e (patch) | |
tree | ed2fd094847673de950889f593528f4bbfc6d4ae | |
parent | 4538dcb01bd76632a364e573682417c7fdbd7217 (diff) | |
download | bcm5719-llvm-bbbbec0b54c55d21404efc41450fbd5f9a96029e.tar.gz bcm5719-llvm-bbbbec0b54c55d21404efc41450fbd5f9a96029e.zip |
[attrs] Run clang-format over a newly added routine in function-attrs
before I update it to be friendly with the new pass manager.
llvm-svn: 260653
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index 2445b7f3c8a..246f7ca93ec 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -943,21 +943,24 @@ static bool removeConvergentAttrs(const CallGraphSCC &SCC, // 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 CallGraphSCC &SCC, 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 CallGraphSCC &SCC, }); }; - // 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 |