[llvm] [LangRef] Clarify to exclude norecurse attribute when any call paths through external functions is present (PR #157087)

Usha Gupta via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 5 09:09:10 PDT 2025


================
@@ -2256,9 +2256,12 @@ For example:
     behavior at runtime if the function ever does dynamically return. Annotated
     functions may still raise an exception, i.a., ``nounwind`` is not implied.
 ``norecurse``
-    This function attribute indicates that the function does not call itself
-    either directly or indirectly down any possible call path. This produces
-    undefined behavior at runtime if the function ever does recurse.
+    This function attribute indicates that the function does not participate in
+    recursion, either directly or through mutual recursion. At runtime it is
+    undefined behavior if any dynamic call stack contains this function more
+    than once at the same time. A function must not be marked ``norecurse`` if,
+    along any call path starting from its body, control may reach an external
+    function whose definition is not available.
----------------
usha1830 wrote:

Thanks, that makes sense. Describing it in terms of cycles in the dynamic call graph is clearer.  I have updated it to use your suggested wording and examples.

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


More information about the llvm-commits mailing list