]> granicus.if.org Git - llvm/commitdiff
FunctionAttrs: Skip it if the effective SCC (ignoring optnone functions) is empty
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 2 Jun 2017 21:24:17 +0000 (21:24 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 2 Jun 2017 21:24:17 +0000 (21:24 +0000)
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

lib/Transforms/IPO/FunctionAttrs.cpp

index 28cc81c76d4fb08f71d2016b2096f60e5be492af..5cc29a49379869e6c808ac2916b4be55e863d45d 100644 (file)
@@ -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);