Ulrich Weigand via llvm-dev
2021-Oct-06 16:14 UTC
[llvm-dev] target ABI: call parameters handling
"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. Bye, Ulrich -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211006/fda601d0/attachment.html>
Reid Kleckner via llvm-dev
2021-Oct-06 17:00 UTC
[llvm-dev] target ABI: call parameters handling
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>