[llvm-dev] Controlling parameter alignment

Momchil Velikov via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 15 04:52:57 PDT 2021




From: Reid Kleckner <rnk at google.com>
> On Wed, Mar 10, 2021 at 6:35 AM Momchil Velikov <momchil.velikov at gmail.com> wrote:
>> So, `byval` arguments adopt the `stackalign` attribute with the same
>> semantics as the current `align`
>> and then `align` is invalid for `byval` arguments ?

> I think there is a backwards compatibility consideration here. It also seems reasonable
> to allow `align` to appear with `byval` as an optimization hint: the optimizer can assume
> the low bits of such a pointer are zero.

Updating the FE to emit `stackalign` for `byval` arguments  would cause quite a bit of churn in the testsuite, but
the updates can be done automatically.

Then in the BE, `byval` arguments will use `stackalign`,  missing that, fall back to uisng `align`  to affect
stack slot alignment.

~chill


More information about the llvm-dev mailing list