[Mlir-commits] [mlir] [mlir][vector] Add mask elimination transform (PR #99314)

Benjamin Maxwell llvmlistbot at llvm.org
Mon Jul 22 01:44:21 PDT 2024


MacDue wrote:

1. The simple pattern matching is done while collecting the unknown dimensions, and functions as an early-exit, as if we can tell that a mask is not going to be all-true we can bail out before doing any more expensive value-bounds analysis. Patterns like this already exist as canonizations, but just give-up on unknown dims rather than trying to resolve them. 

https://github.com/llvm/llvm-project/blob/7af1229b9f2cfab5d5437bf34bbbb272dd9108b6/mlir/lib/Dialect/Vector/Transforms/VectorMaskElimination.cpp#L50-L66

2. I think I'd need to add a nice builder for making all-true/false constant masks first, currently, it's much less ergonomic to build a constant_mask vs an arith.constant, since the only builder for constant_masks takes an ArrayAttr... So you have to build an array of IntegerAttr, which is a bit of a pain.


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


More information about the Mlir-commits mailing list