MLIR

Multi-Level IR Compiler Framework

source

transform.dlti.query (transform::QueryOp) 

Return attribute (as param) associated to key via DTLI

Syntax:

operation ::= `transform.dlti.query` $keys `at` $target attr-dict `:` functional-type(operands, results)

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 keys at target op - or its closest interface-implementing ancestor - by way of the DLTIQueryInterface, which returns an attribute for a key. Each key should be either a (quoted) string or a type. If more than one key is provided, the lookup continues recursively, now on the returned attributes, with the condition that these implement the above interface. For example if the payload IR is

module attributes {#dlti.map = #dlti.map<#dlti.dl_entry<"A",
                                 #dlti.map<#dlti.dl_entry<"B", 42: int>>>} {
  func.func private @f()
}

and we have that %func is a Tranform handle to op @f, then transform.dlti.query ["A", "B"] at %func returns 42 as a param and transform.dlti.query ["A"] at %func returns the #dlti.map attribute containing just the key “B” and its value. Using ["B"] or ["A","C"] as keys will yield an error.

Return modes 

When successful, the result, associated_attr, associates one attribute as a param for each op in target’s payload.

If the lookup fails - as no DLTI attributes/interfaces are found or entries with the right names are missing - a silenceable failure is returned.

Traits: TransformEachOpTrait

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
keys::mlir::ArrayAttrarray attribute

Operands: 

OperandDescription
targetTransformHandleTypeInterface instance

Results: 

ResultDescription
associated_attrTransformParamTypeInterface instance