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

Adam Siemieniuk llvmlistbot at llvm.org
Mon Aug 26 04:42:41 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) {
----------------
adam-smnk wrote:

Shadowing use case is interesting but let's leave that for other time.

Intuitively and based on the API docs, I would expect it to fail on no keys i.e., nothing to match equals no match.
But a special case where empty key means returning DLTI root (or closest or w/e) is IMO also fine as long as it is documented.

Either way, it'd be great if you could add one test case for `transform.dlti.query []` to ensure this is handled at all.

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


More information about the Mlir-commits mailing list