From: David Blaikie Date: Fri, 2 Jun 2017 21:24:17 +0000 (+0000) Subject: FunctionAttrs: Skip it if the effective SCC (ignoring optnone functions) is empty X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffc893deb7106ee0c541b44ef41506a32e1e8350;p=llvm FunctionAttrs: Skip it if the effective SCC (ignoring optnone functions) is empty Minor optimization but mostly simplifies my debugging so I'm not dealing with empty SCCNodeSets while investigating issues in this optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304597 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 28cc81c76d4..5cc29a49379 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -1188,6 +1188,10 @@ static bool runImpl(CallGraphSCC &SCC, AARGetterT AARGetter) { SCCNodes.insert(F); } + // Skip it if the SCC only contains optnone functions. + if (SCCNodes.empty()) + return Changed; + Changed |= addArgumentReturnedAttrs(SCCNodes); Changed |= addReadAttrs(SCCNodes, AARGetter); Changed |= addArgumentAttrs(SCCNodes);