[Mlir-commits] [mlir] [MLIR][DLTI][Transform] Introduce transform.dlti.query (PR #101561)

Renato Golin llvmlistbot at llvm.org
Tue Aug 6 13:00:58 PDT 2024


================
@@ -0,0 +1,61 @@
+//===- DLTITransformOps.td - DLTI transform ops ------------*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef DLTI_TRANSFORM_OPS
+#define DLTI_TRANSFORM_OPS
+
+include "mlir/Dialect/Transform/IR/TransformDialect.td"
+include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.td"
+include "mlir/Dialect/Transform/IR/TransformTypes.td"
+include "mlir/Interfaces/SideEffectInterfaces.td"
+include "mlir/IR/OpBase.td"
+
+def QueryOp : Op<Transform_Dialect, "dlti.query", [
+  TransformOpInterface, TransformEachOpTrait,
+  DeclareOpInterfaceMethods<MemoryEffectsOpInterface>
+]> {
+  let summary = "Return attribute (as param) associated to key via DTLI";
+  let description = [{
+    This op queries data layout and target information associated to payload
+    IR by way of the DLTI dialect. A lookup is performed for the given `key`
+    at the `target` op, with the DLTI dialect determining which interfaces and
+    attributes are consulted.
+
+    When only `key` is provided, the lookup occurs with respect to the data
----------------
rengolin wrote:

This is a currently arbitrary semantics, but I can't see a better way to encode this. 

@ftynse we could probably add a similar _root_ entry to DL like we have for TI. Then there would be no ambiguity.

Not that I like the root entry itself, but it does simplify things a lot.

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


More information about the Mlir-commits mailing list