[Mlir-commits] [mlir] [mlir][tensor] Preserve encoding in more canonicalizers (concat, reshape, pad) (PR #207241)

Dmitrii Makarenko llvmlistbot at llvm.org
Mon Jul 6 02:50:27 PDT 2026


Devjiu wrote:

> > Encodings that do not implement VerifiableTensorEncoding (opaque dict/string/bounds attrs used by downstream dialects) are rank-agnostic
> 
> Is this documented somewhere? This is what the documentation of the `VerifiableTensorEncoding` says:
> 
> ```
>         Verifies the encoding is valid for a tensor type with the
>         given shape and element type. Generates a diagnostic using
>         the supplied callback on failure.
> ```
> 
> This documentation does not specify what happens when an attribute does not implement `VerifiableTensorEncoding`.
> 
> This discussion reminds me a bit of "inherent vs. discardable attributes".

No - fair catch, that was my interpretation, not an existing contract. `VerifiableTensorEncoding`'s doc doesn't say what happens when an attribute doesn't implement it, and there's no documented expectation for `encoding` handling in canonicalizers generally — some passes preserve it, some drop it silently, which is exactly why this PR exists.

Once we land on a policy, I'll write it up in `TensorEncoding.td` to secure the current decision. 

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


More information about the Mlir-commits mailing list