[Mlir-commits] [mlir] [mlir][linalg] Fix getSourceSkipUnary to only skip cast-like ops (PR #198725)
Renato Golin
llvmlistbot at llvm.org
Wed May 27 03:33:41 PDT 2026
rengolin wrote:
> Cool with the keeping specialization conservative, but making the global matcher only accept default-lowering shapes would likely cause broad behavior/test regressions (?)
A regression that was expecting broken behaviour needs to be rejected.
This is about round trips: if you can safely round trip between generic and non-generic and get the exact same representation, then the transformation is safe. If it changes the semantics when it goes back, then it's unsafe.
> Thinking of using `UnaryFnSkipPolicy` or something similar. use `None` or `CastOnly` or `SkipAll`. We can default to `CastOnly` for now -- to fix the problem, and expose the API for specialize pass to change this strictness... wdyt @rengolin ?
This creates unnecessary hurdles and allows for broken semantics where none should be. We should not default to cast only, as I just demonstrated above it's unsafe.
You're trying to fix the wrong problem. You have to understand the semantics before asserting what the problem is.
https://github.com/llvm/llvm-project/pull/198725
More information about the Mlir-commits
mailing list