[llvm] [LoopVectorize] Add llvm.loop.vectorize.fp_reordering.{enable,disable} metadata (PR #219167)

Karthika Devi C via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 03:12:27 PDT 2026


kartcq wrote:

> > When absent, allowReordering() retains its existing behaviour: vectorize.enable or an explicit vector width > 1 grants FP reordering. When present, the hint takes precedence over that default.
> 
> TIL
> 
> I think given that this already introduces new metadata to control this separately, it would be a good idea to also change the vectorize.enable metadata to not imply this.
> 
> Also I found this additional code:
> 
> https://github.com/llvm/llvm-project/blob/a945adae2eb9236392fbbfe1ab5181f8c073d6f8/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h#L178-L185
> 
> Don't you need to change it as well? (Possibly making this just about "fp_reordering" is not quite right in that case.)

Hi @nikic 

Regarding decoupling vectorize.enable from implying FP reordering — I agree that's the right long-term direction, and there has been prior discussion around this in #198726. This patch was introduced keeping the existing behaviour as-is since it is not tested otherwise.

Regarding isPotentiallyUnsafe() — that's a good catch. I'm not sure whether fp_reordering.enable should also override it. I can make changes if you think that's the right direction. @fhahn do you have any thoughts on this?

cc : @madhur13490 @efriedma-quic 


https://github.com/llvm/llvm-project/pull/219167


More information about the llvm-commits mailing list