[Mlir-commits] [mlir] [mlir][vector] Allow signless integer element types in `vector.step` (PR #205142)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Jun 25 07:12:10 PDT 2026


banach-space wrote:

Thank you for that clear summary, @victor-eds ! 

I like your proposal re `StepToArithConstantOpRewrite ` behaviour from your Option 3. In fact, I see one more alternative that blends 2. and 3.:

4. **Fold (optionally) + lower to llvm.stepvector**

>From your option 3.

>  Fixed-width integer element type + fixed-length vector folds to a constant (encoding the wrap-around semantics); everything else stays as vector.step and lowers to llvm.stepvector. 

+1, when `StepToArithConstantOpRewrite` is _enabled_ (we'd add a flag to `ConvertVectorToLLVM`). Then, from option 2.

> the op stays in the module until target lowering.

+1 as the default behaviour of `ConvertVectorToLLVM`. `StepToArithConstantOpRewrite` would be hidden behind a flag. No opinion re `ConvertVecotToSPRIV`.

How does it sound?

> We can move this pattern over to spirv if that's the only remaining user

The location is secondary, IMO. I just don't believe that it should be run unconditionally in `ConvertVectorToLLVM`.

WDYT?

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


More information about the Mlir-commits mailing list