[Mlir-commits] [mlir] [mlir][vector] Add vector.transpose with unit-dim to vector.shape_cast pattern (PR #72105)

Mehdi Amini llvmlistbot at llvm.org
Wed Nov 22 00:19:13 PST 2023


joker-eph wrote:

I don't follow, because from what I understand in your explanation: basically **any** new canonicalization can break an existing pattern and a such the owner of this pattern would say that this isn't a canonicalization.

The question isn't if your analysis would be broken by the canonicalization, the question is "is there data loss"? If not it is just a matter of revisiting your analysis to be complete...
Of course it can be inconvenient if your analysis is specifically focused on finding "transpose", but that's not the central point here.
For example if my analysis is trying to find all subtraction in the program, but a canonicalization rewrite all "subtraction of a negative constant" to an "addition of the positive constant" (or all `fadd(x, fneg(y))` -> `fsub(x, y)`), the part where "I need to match a subtraction" may be broken and I need to do more work. 

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


More information about the Mlir-commits mailing list