[Mlir-commits] [mlir] [mlir][linalg] Reject linalg.map payloads that read the init argument (PR #235745)
Chanj Wons
llvmlistbot at llvm.org
Mon Oct 26 05:52:56 PDT 2026
wonschangge wrote:
@rengolin already noted on #196959 that the earlier related discussion did not settle `linalg.map` semantics, and asked for consensus (and possibly a short RFC) before changing Linalg op behavior. His personal preference there was the opposite of this PR: keep the init block argument usable, like other structured ops, and update `payloadUsesValueFromOperand` rather than reject init uses in verify. I read that guidance and do not want to advance a quick patch that conflicts with it.
This PR takes the other side only as a consistency fix against the *current* helper contract: after #162742, `payloadUsesValueFromOperand` already treats the init operand as unused, while the op docs never stated that reading the destination is allowed, and `MapOp::verify` did not enforce that unused-init side. I am not claiming this is the settled design.
Please advise which path to take:
1. Keep reject-uses for now (align verify with the existing helper).
2. Flip the approach: allow reading init, update `payloadUsesValueFromOperand` (and docs), and reshape this PR accordingly.
3. Convert this PR to draft / close it and start a short Discourse RFC first (who uses `linalg.map`, and what semantics are expected).
@rengolin @nicolasvasilache @dcaballe — and anyone with real `map` use cases — I will follow whichever direction you prefer before making further changes.
https://github.com/llvm/llvm-project/pull/235745
More information about the Mlir-commits
mailing list