[Mlir-commits] [mlir] [mlir][vector] Support complete folding in single pass for vector.insert/vector.extract (PR #142124)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Jun 10 08:28:20 PDT 2025


banach-space wrote:

> I personally lean more towards the second option.

That's fine with me, thanks for being flexible!

On a related note, rather than creating a C++ pass (which would impact MLIR compilation time), why not try creating a TD Op instead? There are already Ops for applying canonicalisation patterns:
* https://mlir.llvm.org/docs/Dialects/Transform/#transformapply_patternscanonicalization-transformapplycanonicalizationpatternsop

You would probably have to introduce something new though, from [transform.apply_patterns](https://mlir.llvm.org/docs/Dialects/Transform/#transformapply_patterns-transformapplypatternsop):
> greedily applies the specified patterns to the body of the targeted op until a fixpoint was reached.

That's the opposite of what you need. @ftynse , is there a good TD mechanism to apply a pattern/folder **exactly once**?

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


More information about the Mlir-commits mailing list