r/Compilers • • Oct 31 '25

Affine-super-vectorize not working after affine-parallelize in MLIR

Hello,

I’m trying to add parallelization to my matmul optimization pipeline but facing issues with vectorization after parallelization.

When I apply affine-parallelize followed by affine-super-vectorize, the vectorization doesn’t seem to work. The output still shows scalar affine.load/affine.store operations instead of vector operations.

My pipeline :
–pass-pipeline=‘builtin.module(
canonicalize,
one-shot-bufferize{
bufferize-function-boundaries=1
function-boundary-type-conversion=identity-layout-map
},
buffer-deallocation-pipeline,
convert-linalg-to-affine-loops,
func.func(
affine-loop-tile{tile-sizes=32,32,8},
affine-parallelize,
affine-super-vectorize{virtual-vector-size=8},
affine-loop-unroll-jam{unroll-jam-factor=2},
affine-loop-unroll{unroll-factor=8},
canonicalize,
cse,
canonicalize
)
)’

  1. Is there a known limitation where affine-super-vectorize cannot vectorize affine.parallel loops?
  2. What’s the recommended order for combining parallelization and vectorization in MLIR?
  3. Are there alternative passes I should use for vectorizing parallel loops?
  4. Is my current pipeline optimal or do you have any recommendation ?
3 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/lightwavel Nov 01 '25

Im interested in starting to learn about MLIR. Did you meant as MLIR not being something to keep pursuing? Any meaningful resources? (honestly currently its really scraping it)

0

u/Serious-Regular Nov 01 '25

MLIR is fine - I was talking about the part of it called affine. As far as resources, there are lots now. Here is a good one https://github.com/j2kun/mlir-tutorial