[Mlir-commits] [mlir] [mlir] NamedAttribute utility generator (PR #75118)

Mehdi Amini llvmlistbot at llvm.org
Fri Dec 15 17:59:53 PST 2023


joker-eph wrote:

> since we can't inject code into other people's verify() methods

Can you clarify what you have in mind exactly? (I don't know if you're familiar with https://mlir.llvm.org/docs/DefiningDialects/#discardable-attribute-verification ; I would assume so since you give the example of `gpu.container_module`which is exactly doing that).

> Dialect-wide attribute grab bags that aren't repeated as properties on every operation. For example, stuff like llvm.align, llvm.invariant_load, and so on and so forth. In principle, we could go clean all that up and give every LLVM dialect operation a long list of properties matching exactly the kind of metadata or attributes you can put on it in LLVM IR ... 

There is an semantic difference between "discardable" and "inherent" attributes: it's not clear to me if you're mixing these up together like if an attribute can be either of these as only a "cosmetic" thing.

> Making this its own tablegen record type would have the advantage of allowing you to generate documentation automatically as well, for instance, but it is a lot more work.

"TableGen record" is not something well defined without connecting this to a backend.
I'm mostly pointing out that using AttrDef just does not seem right to me here: I haven't perceived a requirement that would justify doing this (other than it's there and you can tweak it to get something that kind of look like providing some of the feature you want).


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


More information about the Mlir-commits mailing list