[llvm-dev] target ABI: call parameters handling

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 6 10:00:44 PDT 2021


On Wed, Oct 6, 2021 at 9:15 AM Ulrich Weigand <Ulrich.Weigand at de.ibm.com>
wrote:

> "Reid Kleckner" <rnk at google.com> wrote on 06.10.2021 04:31:15:
>
> > Well, the annotation isn't strictly necessary. The backend can
> > choose to emit an extension for short integer arguments in the
> > absence of annotations.
>
> As I commented in another mail, unfortunately this is not true.
> To ensure correct codegen in all cases, we need to know *which*
> extension the callee expects: zero- or sign-extension.  The
> backend cannot know this without being told by the frontend.
>
Maybe this is just a wording thing, but I do believe my statement is true:
the backend is absolutely free to guess if it wants to, and requiring
attributes doesn't guarantee correctness. It may just move the bug to the
frontend. I acknowledge that there are risks to guessing. I just think it
is important to consider alternative designs and weigh the pros and cons.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211006/a8debb30/attachment.html>


More information about the llvm-dev mailing list