[llvm] [ArgPromotion] Handle pointer arguments of recursive calls (PR #78735)

Vedant Paranjape via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 06:24:39 PDT 2024


================
@@ -744,8 +794,10 @@ static Function *promoteArguments(Function *F, FunctionAnalysisManager &FAM,
     if (CB->isMustTailCall())
       return nullptr;
 
-    if (CB->getFunction() == F)
+    if (CB->getFunction() == F) {
       IsRecursive = true;
+      IsSelfRecursive = true;
+    }
----------------
vedantparanjape-amd wrote:

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.

Yes, but is it guaranteed that each such function will be tagged norecursive ? Also, we'd still need to check for self recursion. That said, can this be submitted as a separate patch ?

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


More information about the llvm-commits mailing list