[llvm] [AMDGPU] Avoid resource propagation for recursion through multiple functions (PR #111004)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 09:04:04 PDT 2024


================
@@ -167,7 +237,15 @@ void MCResourceInfo::gatherResourceInfo(
       if (!Callee->isDeclaration()) {
         MCSymbol *calleeValSym =
             getSymbol(Callee->getName(), RIK_PrivateSegSize, OutContext);
-        ArgExprs.push_back(MCSymbolRefExpr::create(calleeValSym, OutContext));
+        if (calleeValSym->isVariable()) {
+          if (!foundRecursiveSymbolDef(
+                  Sym, calleeValSym->getVariableValue(/*isUsed=*/false))) {
+            ArgExprs.push_back(
+                MCSymbolRefExpr::create(calleeValSym, OutContext));
+          }
+        } else {
----------------
arsenm wrote:

Same, can turn this into one conditional push_back? 

https://github.com/llvm/llvm-project/pull/111004


More information about the llvm-commits mailing list