[llvm] [LV][IRBuilder] Allow implicit truncation of step vector (PR #173229)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 23 10:28:24 PST 2025


paulwalker-arm wrote:

I'm less sure about the change. I feel either LoopVectorize is using CreateStepVector wrong or the intrinsic definition should be changed to require wrapping rather than poison.  My guess is that for scalable vectors LoopVectorize is benefitting from the current "less than 8-bit" hack.  I guess you could extend that to cover fixed length vectors as well? That would make them consistent and any future "implicit truncation" failures would then be applicable to scalable vectors as well?

It's worth saying we were pushed into this poison behaviour when adding the support, but I never liked it.  The same was done for ISD::STEP_VECTOR but later its definition was changed to implement wrapping rather than poison. I'd very much like the intrinsic's definition to match the ISD node, but I'm not sure if there's any code relying on step-vector being monotonic.

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


More information about the llvm-commits mailing list