On Tue, 29 Jul 2025, Pengfei Li wrote: > 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.
But then if the early break code for speculative loads says a specific target_alignment that also happens to be constant is OK, then it's wrong no? I'd have expected that to be the vector size which is POLY and thus fail in the same way as the vector size check does now? Richard.