[Mlir-commits] [mlir] [MLIR][DLTI] Enable types as keys in DLTI-query utils (PR #105995)

Renato Golin llvmlistbot at llvm.org
Mon Aug 26 05:13:35 PDT 2024


================
@@ -424,8 +424,8 @@ getClosestQueryable(Operation *op) {
   return std::pair(queryable, op);
 }
 
-FailureOr<Attribute> dlti::query(Operation *op, ArrayRef<StringAttr> keys,
-                                 bool emitError) {
+FailureOr<Attribute>
+dlti::query(Operation *op, ArrayRef<DataLayoutEntryKey> keys, bool emitError) {
----------------
rengolin wrote:

> At the moment an empty `keys` would return the DLTI attribute that is closest to `op`, if such an attribute exists. This behaviour might be useful/desirable - you could then work directly with that attribute, for example.

I would not go there. Dictionaries do not guarantee order and you could have inconsistent behaviour across runs. I would right now restrict what we can put in keys and have tests for the cases where we care about and negative tests for the ones we know could work but we restrict to avoid complexity.

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


More information about the Mlir-commits mailing list