[Mlir-commits] [mlir] [MLIR][DLTI] Make DLTI queries visit all ancestors/respect nested scopes (PR #115043)

Renato Golin llvmlistbot at llvm.org
Wed Nov 20 01:50:48 PST 2024


rengolin wrote:

> 1. Shadowing a DLTI attribute with a non-DLTI attribute is invalid and should be checked by the verifier.

Agree.

> 2. We could defer to specific entries to indicate whether they are "overridable" in certain contexts

Agree, but this is very complex. You could also ask _how_ they're overridable (sub-range, only-increase, only-decrease, replace entirely), and if the overriding is for that node only or all sub-nodes. I'd rather leave that discussion for when we really need it.

> 3. Mutating the IR invalidates the analysis, as is customary.

We discussed this a lot downstream. One idea is to have the top-level DLTI dictionary to be invariant ("came from above") and leave the result of any analysis (that could be invalidated) as new attributes to functions, regions, operations. Those could be invalidated by transformations. But again, this brings infrastructure complexity and we should only design when we need it.

> 4. My personal opinion is the caching mechanism in the data layout object was implemented prematurely, but we reached consensus on its theoretical necessity.

Good, we reached a similar conclusion. Caching brings all sorts of invalidation problems, especially in view of multi-threaded compilers (isolated-from-above) and central source of information.

> My recommendation would be to collect some performance data, if possible, to support or not the need for the cache.

This should be an exercise for another day. Right now, as far as we know, the users of this dialect do not need caching and implementing fully-coherent caching system in MLIR just for DLTI would be overkill.

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


More information about the Mlir-commits mailing list