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

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 13:58:07 PDT 2024


================
@@ -610,6 +658,48 @@ static bool findArgParts(Argument *Arg, const DataLayout &DL, AAResults &AAR,
       // unknown users
     }
 
+    auto *CB = dyn_cast<CallBase>(V);
+    Value *PtrArg = cast<Value>(U);
+    if (IsRecursive && CB && PtrArg) {
----------------
efriedma-quic wrote:

This IsRecursive check doesn't look right: it checks whether the function contains a recursive call somewhere, but it doesn't check whether this particular call is recursive.

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


More information about the llvm-commits mailing list