Yup. See: RFC : Update to "General Design" section of Operation Canonicalizations in MLIR
Batched operations are semantically different than their non-batched versions, even if the batch is 1. True, they have “the same lowering” but only if done straight away. If there’s a pass in the middle that looks for batched ops (even with batch = 1), then those passes will fail to match and you may lower to a less optimal code. Same is true for ND shapes whose “extra dimensions” are all ones, etc.
Other things look easier, like constant folding, but even those can be tricky. So, I’d treat all of those patterns are optional, chosen by the compiler (who builds the pipeline) and not enforced by some generic catch-all canonicalization pass.
Perhaps we should be discussing how we’re going to parametrize the canonicalizer pass instead?