On Mon, Sep 15, 2025 at 11:52 AM Robin Dapp <[email protected]> wrote: > > > The rest of the GCN hook is quite inconsistent, it says misalignment > > == -1 is OK, is_packed > > is not and then the above ... and gather-scatter is also always OK > > (even if the scalar accesses > > are 'packed' aka not naturally aligned?) > > The gather_scater -> ok I added during the introduction of is_gather_scatter. > That was to keep the old behavior where we didn't check the alignment at all. > > > Note this leaves unspecified whether a known misalignment means the > > original scalar memory access _is_ naturally aligned? I think it needs > > not, but I'd have to check alignment analysis if we force the result to -1 > > in such case. > > We can just set is_packed every time? And adjust the targets that > unconditionally return false when is_packed to misalignment == -1 && is_packed > in order to keep the current behavior?
Yeah, that feels safest and most useful to me. Richard. > > I think most is_packed uses think of alignment according to size. > > > > Note that we only communicate misalignment to the hook, not alignment > > (that's implicit, alignment of the passed mode). But that means for the > > x86 'double' the misalignment with respect to the vector alignment is > > unknown > > but we might know the access is aligned to 4 bytes. So is_packed is > > basically > > the poor-mans way to communicate this, and we should see to define that > > with respect to alignment according to size? > > > -- > Regards > Robin >
