[clang] [Clang] Forward incoming Indirect parameters across musttail calls (PR #199351)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon May 25 23:28:23 PDT 2026


================
@@ -5448,6 +5472,45 @@ static unsigned getMaxVectorWidth(const llvm::Type *Ty) {
   return MaxVectorWidth;
 }
 
+/// Returns the incoming llvm::Argument of the current function if this
+/// musttail call argument forwards an incoming Indirect parameter with a
+/// matching ABI shape; nullptr to fall through to the byval-temp path.
+/// Argument-side analog of a96c14eeb8fc (SRet musttail forwarding).
----------------
efriedma-quic wrote:

This is not really how I'd expect this to work... you've optimized a special case, but haven't fixed the general case.  In general, you need to emit a copy from some local alloca into the argument pointer.

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


More information about the cfe-commits mailing list