|
MLIR 22.0.0git
|
Base class for PyOperation and PyOpView which exposes the primary, user visible methods for manipulating it. More...
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
| virtual | ~PyOperationBase ()=default |
| void | print (std::optional< int64_t > largeElementsLimit, std::optional< int64_t > largeResourceLimit, bool enableDebugInfo, bool prettyDebugInfo, bool printGenericOpForm, bool useLocalScope, bool useNameLocAsPrefix, bool assumeVerified, nanobind::object fileObject, bool binary, bool skipRegions) |
| Implements the bound 'print' method and helps with others. | |
| void | print (PyAsmState &state, nanobind::object fileObject, bool binary) |
| nanobind::object | getAsm (bool binary, std::optional< int64_t > largeElementsLimit, std::optional< int64_t > largeResourceLimit, bool enableDebugInfo, bool prettyDebugInfo, bool printGenericOpForm, bool useLocalScope, bool useNameLocAsPrefix, bool assumeVerified, bool skipRegions) |
| void | writeBytecode (const nanobind::object &fileObject, std::optional< int64_t > bytecodeVersion) |
| void | walk (std::function< MlirWalkResult(MlirOperation)> callback, MlirWalkOrder walkOrder) |
| void | moveAfter (PyOperationBase &other) |
| Moves the operation before or after the other operation. | |
| void | moveBefore (PyOperationBase &other) |
| bool | isBeforeInBlock (PyOperationBase &other) |
| Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block. | |
| bool | verify () |
| Verify the operation. | |
| virtual PyOperation & | getOperation ()=0 |
| Each must provide access to the raw Operation. | |
Base class for PyOperation and PyOpView which exposes the primary, user visible methods for manipulating it.
Definition at line 552 of file IRModule.h.
|
virtualdefault |
| nb::object PyOperationBase::getAsm | ( | bool | binary, |
| std::optional< int64_t > | largeElementsLimit, | ||
| std::optional< int64_t > | largeResourceLimit, | ||
| bool | enableDebugInfo, | ||
| bool | prettyDebugInfo, | ||
| bool | printGenericOpForm, | ||
| bool | useLocalScope, | ||
| bool | useNameLocAsPrefix, | ||
| bool | assumeVerified, | ||
| bool | skipRegions ) |
Definition at line 1198 of file IRCore.cpp.
References print().
|
pure virtual |
Each must provide access to the raw Operation.
Implemented in mlir::python::PyOperation, and mlir::python::PyOpView.
Referenced by mlir::python::PyInsertionPoint::after(), mlir::python::PySymbolTable::erase(), getOpResultOrValue(), mlir::python::PySymbolTable::getSymbolName(), mlir::python::PySymbolTable::getVisibility(), mlir::python::PyInsertionPoint::insert(), mlir::python::PySymbolTable::insert(), isBeforeInBlock(), moveAfter(), moveBefore(), mlir::python::PyAsmState::PyAsmState(), mlir::python::PySymbolTable::replaceAllSymbolUses(), mlir::python::PySymbolTable::setSymbolName(), mlir::python::PySymbolTable::setVisibility(), verify(), walk(), mlir::python::PySymbolTable::walkSymbolTables(), and writeBytecode().
| bool PyOperationBase::isBeforeInBlock | ( | PyOperationBase & | other | ) |
Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block.
Note: This function has an average complexity of O(1), but worst case may take O(N) where N is the number of operations within the parent block.
Definition at line 1244 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), and mlirOperationIsBeforeInBlock().
| void PyOperationBase::moveAfter | ( | PyOperationBase & | other | ) |
Moves the operation before or after the other operation.
Definition at line 1226 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), and mlirOperationMoveAfter().
| void PyOperationBase::moveBefore | ( | PyOperationBase & | other | ) |
Definition at line 1235 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), and mlirOperationMoveBefore().
| void mlir::python::PyOperationBase::print | ( | PyAsmState & | state, |
| nanobind::object | fileObject, | ||
| bool | binary ) |
| void mlir::python::PyOperationBase::print | ( | std::optional< int64_t > | largeElementsLimit, |
| std::optional< int64_t > | largeResourceLimit, | ||
| bool | enableDebugInfo, | ||
| bool | prettyDebugInfo, | ||
| bool | printGenericOpForm, | ||
| bool | useLocalScope, | ||
| bool | useNameLocAsPrefix, | ||
| bool | assumeVerified, | ||
| nanobind::object | fileObject, | ||
| bool | binary, | ||
| bool | skipRegions ) |
Implements the bound 'print' method and helps with others.
Referenced by getAsm().
| bool PyOperationBase::verify | ( | ) |
Verify the operation.
Throws MLIRError if verification fails, and returns true otherwise.
Definition at line 1252 of file IRCore.cpp.
References mlir::python::PyOperation::get(), mlir::python::BaseContextObject::getContext(), getOperation(), mlirOperationVerify(), and mlir::python::PyMlirContext::ErrorCapture::take().
| void PyOperationBase::walk | ( | std::function< MlirWalkResult(MlirOperation)> | callback, |
| MlirWalkOrder | walkOrder ) |
Definition at line 1166 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), and mlirOperationWalk().
| void PyOperationBase::writeBytecode | ( | const nanobind::object & | fileObject, |
| std::optional< int64_t > | bytecodeVersion ) |
Definition at line 1144 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), mlir::config, mlir::PyFileAccumulator::getCallback(), getOperation(), mlir::PyFileAccumulator::getUserData(), mlirBytecodeWriterConfigCreate(), mlirBytecodeWriterConfigDesiredEmitVersion(), mlirBytecodeWriterConfigDestroy(), mlirLogicalResultIsFailure(), mlirOperationWriteBytecode(), and mlirOperationWriteBytecodeWithConfig().