[PATCH] D120622: [AArch64] Use correct calling convention for each vararg

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 17:17:27 PST 2022


efriedma added a comment.

In D120622#3355792 <https://reviews.llvm.org/D120622#3355792>, @rnk wrote:

> I kind of side tracked the review, sorry about that. What's the next step here? Is it worth taking the time to rewrite this logic to refactor it and divide the musttail-relevant checks from the regular checks, or should we go forward with improving this patch?

This patch looks more complicated than it actually is because it's copy-pasting code.  The new code is doing exactly the same thing as the old code, except it's using the target-specific form of AnalyzeCallOperands.

Like I said before, I'd rather keep the codepaths unified if possible.  If we need to skip some specific check for musttail, we can do that explicitly.  There are multiple cases where musttail actually doesn't work, and a compiler crash in those cases seems better than silently miscompiling code.

> I think I don't like the complexity in this patch. Ideally, I would like to declare non-musttail vararg tail calls to be unsupported: we shouldn't have to forward variadic arguments between functions with mismatched prototypes.

Forwarding variadic arguments isn't a thing outside of musttail.  For non-musttail calls, whether the call is variadic doesn't really change the necessary checks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120622/new/

https://reviews.llvm.org/D120622



More information about the llvm-commits mailing list