[llvm] [FuncAttrs] Relax norecurse attribute inference (PR #139943)

Usha Gupta via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 13 03:03:12 PDT 2025


================
@@ -2322,8 +2352,29 @@ PreservedAnalyses PostOrderFunctionAttrsPass::run(LazyCallGraph::SCC &C,
     Functions.push_back(&N.getFunction());
   }
 
+  bool AnyFunctionsAddressIsTaken = false;
+  // Check if any function in the whole program has its address taken.
+  // We use this information when inferring norecurse attribute: If there is
+  // no function whose address is taken, we conclude that any external function
+  // cannot callback into any user function.
----------------
usha1830 wrote:

Updated to assume address is taken when there exists any function which doesn't have private/internal linkage.

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


More information about the llvm-commits mailing list