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

Vedant Paranjape via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 09:00:37 PDT 2024


================
@@ -611,6 +639,33 @@ static bool findArgParts(Argument *Arg, const DataLayout &DL, AAResults &AAR,
       // unknown users
     }
 
+    auto *CB = dyn_cast<CallBase>(V);
+    Value *PtrArg = cast<Value>(U);
+    if (CB && PtrArg && CB->getCalledFunction() == CB->getFunction()) {
----------------
vedantparanjape-amd wrote:

> The call and the function have separate types that do not match:
> 
> ```
> declare float @ret_float()
> 
> define i32 @call_as_i32() {
>   %val = call i32 @ret_float()
>   ret i32 %val
> }
> ```

I didn't know this was possible, like I mean valid. Okay, I will check for the return types as well.

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


More information about the llvm-commits mailing list