> -----Original Message-----
> From: Pengfei Li <pengfei....@arm.com>
> Sent: Tuesday, July 29, 2025 12:10 PM
> To: Richard Biener <rguent...@suse.de>
> Cc: Tamar Christina <tamar.christ...@arm.com>; Richard Biener
> <richard.guent...@gmail.com>; gcc-patches@gcc.gnu.org; s...@gentoo.org
> Subject: Re: [PATCH] vect: Fix insufficient alignment requirement for 
> speculative
> loads [PR121190]
> 
> Hi Richi,
> 
> > But why do we need to reject VLA vectorization for versioning when
> > the target only requires element alignment?  I could for example
> > think that arm could have gone with requiring NEON vector size
> > alignment for SVE accesses.
> >
> > I do agree that keeping the old check is "safe", but I wonder why
> > this needs to reject a poly-int VF?
> 
> Tamar can correct me if I'm wrong.
> 
> For VLA vectorization, element alignment is definitely not sufficient if
> speculative loads are present. I don't think existing versioning logic has
> taken VLA modes into account. For example, the mask (= size - 1) to test the
> rightmost bits of addresses should be a poly for VLA modes. I'm currently
> working on a patch to extend peeling with masking from VLS modes to VLA
> modes.
> So this is what I will address soon.

The specific section for this code is when strict alignment is required,
So dr_unaligned_unsupported.  For VLA we don't support alignment
peeling today. (We only do for VLS).

Pengfei is working on adding alignment peeling support for VLA.

No SVE system today requires strict alignment though, so before
early break this wasn't an issue as predication makes the
misalignment a non-issue.

It's only the speculative loads for early break that now requires the
strict alignment and masking won't help in this case.

Cheers,
Tamar
> 
> --
> Thanks,
> Pengfei

Reply via email to