mlir.ir¶
Functions¶
|
Return the closest enclosing parent operation of the given type. |
|
Return all operations of the given type in the operation tree. |
|
Enables automatic traceback-based locations for MLIR operations. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents¶
- mlir.ir.get_parent_of_type(op: OpView | Operation, op_class: type[OpView]) OpView | None¶
Return the closest enclosing parent operation of the given type.
Walks the parent chain of op and returns the first ancestor that is an instance of op_class. Returns
Noneif no matching parent is found.- Parameters:
op – The starting operation.
op_class – The OpView subclass to search for (e.g.
func.FuncOp).
- mlir.ir.get_ops_of_type(root: OpView | Operation | Module, op_class: type[OpView] | None = None) list[OpView]¶
Return all operations of the given type in the operation tree.
- Parameters:
root – The operation or module to start traversing from.
op_class – The OpView subclass to filter by (e.g. func.FuncOp). If None, collects all operations in the tree.
- Returns:
A list of operations of the given type.
- mlir.ir.loc_tracebacks(*, max_depth: int | None = None, on_explicit_actn: _mlir_libs._mlir.OnExplicitAction = OnExplicitAction.USE_EXPLICIT, current_loc_actn: _mlir_libs._mlir.CurrentLocAction = CurrentLocAction.FALLBACK) collections.abc.Generator[None, None, None]¶
Enables automatic traceback-based locations for MLIR operations.
Operations created within this context will have their location automatically set based on the Python call stack.
- Parameters:
max_depth – Maximum number of frames to include in the location. If None, the default limit is used.
on_explicit_actn –
Policy when an explicit loc= is passed to an op constructor. OnExplicitAction.USE_EXPLICIT (default) — use loc= as base, skip
traceback.
OnExplicitAction.USE_TRACEBACK — discard loc=, generate traceback.
current_loc_actn –
Policy for composing Location.current with the result. CurrentLocAction.FALLBACK (default) — use Location.current only as
fallback.
- CurrentLocAction.NAMELOC_WRAP — extract NameLoc names from
Location.current and wrap the computed location with them.
- mlir.ir.register_attribute_builder(kind, replace=False, allow_existing=False)¶
- mlir.ir._affineMapAttr(x, context)¶
- mlir.ir._integerSetAttr(x, context)¶
- mlir.ir._boolAttr(x, context)¶
- mlir.ir._dictAttr(x, context)¶
- mlir.ir._indexAttr(x, context)¶
- mlir.ir._i1Attr(x, context)¶
- mlir.ir._i8Attr(x, context)¶
- mlir.ir._i16Attr(x, context)¶
- mlir.ir._i32Attr(x, context)¶
- mlir.ir._i64Attr(x, context)¶
- mlir.ir._si1Attr(x, context)¶
- mlir.ir._si8Attr(x, context)¶
- mlir.ir._si16Attr(x, context)¶
- mlir.ir._si32Attr(x, context)¶
- mlir.ir._si64Attr(x, context)¶
- mlir.ir._ui1Attr(x, context)¶
- mlir.ir._ui8Attr(x, context)¶
- mlir.ir._ui16Attr(x, context)¶
- mlir.ir._ui32Attr(x, context)¶
- mlir.ir._ui64Attr(x, context)¶
- mlir.ir._f32Attr(x, context)¶
- mlir.ir._f64Attr(x, context)¶
- mlir.ir._stringAttr(x, context)¶
- mlir.ir._symbolNameAttr(x, context)¶
- mlir.ir._symbolRefAttr(x, context)¶
- mlir.ir._flatSymbolRefAttr(x, context)¶
- mlir.ir._unitAttr(x, context)¶
- mlir.ir._arrayAttr(x, context)¶
- mlir.ir._affineMapArrayAttr(x, context)¶
- mlir.ir._boolArrayAttr(x, context)¶
- mlir.ir._dictArrayAttr(x, context)¶
- mlir.ir._flatSymbolRefArrayAttr(x, context)¶
- mlir.ir._i32ArrayAttr(x, context)¶
- mlir.ir._i64ArrayAttr(x, context)¶
- mlir.ir._i64SmallVectorArrayAttr(x, context)¶
- mlir.ir._indexListArrayAttr(x, context)¶
- mlir.ir._f32ArrayAttr(x, context)¶
- mlir.ir._f64ArrayAttr(x, context)¶
- mlir.ir._strArrayAttr(x, context)¶
- mlir.ir._symbolRefArrayAttr(x, context)¶
- mlir.ir._denseF32ArrayAttr(x, context)¶
- mlir.ir._denseF64ArrayAttr(x, context)¶
- mlir.ir._denseI8ArrayAttr(x, context)¶
- mlir.ir._denseI16ArrayAttr(x, context)¶
- mlir.ir._denseI32ArrayAttr(x, context)¶
- mlir.ir._denseI64ArrayAttr(x, context)¶
- mlir.ir._denseBoolArrayAttr(x, context)¶
- mlir.ir._typeAttr(x, context)¶
- mlir.ir._typeArrayAttr(x, context)¶
- mlir.ir._memref_type_attr(x, context)¶
- mlir.ir._f64ElementsAttr(x, context)¶