Bug in --convert-linalg-to-affine-loops?

Hello again. I would like to apply the pass you were working on after a linalg-codegen-strategy pass, but I’m having trouble with -linalg-generalize-named-ops when the promote-full-tile-pad option is used. In the following, I will ignore the interchange for now since my current issue is with generalize.

If I do,

mlir-opt linalg-matmul.mlir -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=1,2,4" -linalg-generalize-named-ops

this works fine. If I add the promote option

mlir-opt linalg-matmul.mlir -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=1,2,4 promote" -linalg-generalize-named-ops

this also works fine. However when I use promote-full-tile-pad

./bin/mlir-opt ../linalg-matmul.mlir -test-linalg-codegen-strategy="anchor-func=matmul anchor-op=linalg.matmul tile-sizes=1,2,4 promote promote-full-tile-pad" -linalg-generalize-named-ops

I get the following error

mlir-opt: /llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:353: static void mlir::linalg::FillOp::regionBuilder(mlir::Block&, mlir::ValueRange): Assertion `captures.size() == 1 && "FillOp regionBuilder expects 1 capture"' failed.

I may be naive trying to do this in the first place. I’m essentially trying to follow slide 133 from Structured and Retargetable Compilation With Vectors.pdf - Google Drive and add my own stuff on top of it.
Honestly, I don’t have a solid understanding of promote, but it basically looks like there’s a problem trying to generalize the fill op. Should this work? If not, what else could I do to achieve something similar.

Thanks!

I tried your command line and it seems to work for me (or at least I get IR and not an assertion). Could it be that you are on a slightly older commit? The reason I ask is that I pushed a patch recently that may solve the issue you are experiencing https://reviews.llvm.org/D100880. It even adds a unit test for the fill operation :smile:.

Oops. Yah I was 10 days out of date. My bad. Fixed now. Thanks again