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

Diego Caballero llvmlistbot at llvm.org
Sat Aug 3 16:46:55 PDT 2024


dcaballe wrote:

Thanks for the clarifications!

> I think you are misunderstanding how this patch works. There are no lightweight canonicalizations added here (or any patterns really). Such lightweight canonicalizations already exist, and this code does not re-implement them, I was simply saying this code follows a similar idea.

Sorry if that is the case but I'm not sure how else I could interpret this:

> It attempts to do this by simply pattern-matching the mask operands (similar to some canonicalizations), if that does not lead to an answer (is all-true? yes/no), then value bounds analysis will be used to find the lower bound of the unknown operands.

The lightweight part that I'm referring as a canonicalization, based on this sentence, is the "pattern-matching the mask operands" that leads to an all-true answer without using the value bounds analysis.

More specifically: 

> Let's look at the actual code here:

My understanding is that if `unknownDims` is empty after that loop and no `failure()` path is taken, we are in an all-true mask case that do not require value bounds analysis (i.e., the lightweight case). If the answer to this is that this canonicalization already exists, then great! That's basically what I've been asking for :).

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


More information about the Mlir-commits mailing list