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>
Ulrich Weigand via llvm-dev
2021-Oct-07 17:39 UTC
[llvm-dev] target ABI: call parameters handling
"Reid Kleckner" <rnk at google.com> wrote on 06.10.2021 19:00:44:> On Wed, Oct 6, 2021 at 9:15 AM Ulrich Weigand <Ulrich.Weigand at de.ibm.com>wrote:>> 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.I guess it's indeed just wording, and we agree on the substance. Thanks, Ulrich -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211007/f8f1bfaf/attachment.html>
Jonas Paulsson via llvm-dev
2021-Nov-01 18:15 UTC
[llvm-dev] target ABI: call parameters handling
Sorry for the delay on this... Please find my initial patch proposal at https://reviews.llvm.org/D112942. /Jonas On 2021-10-07 19:39, Ulrich Weigand wrote:> > "Reid Kleckner" <rnk at google.com> wrote on 06.10.2021 19:00:44: > > On Wed, Oct 6, 2021 at 9:15 AM Ulrich Weigand > <Ulrich.Weigand at de.ibm.com> wrote: > >> 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. > > I guess it's indeed just wording, and we agree on the substance. > > Thanks, > Ulrich > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211101/7963332e/attachment.html>