MLIR
20.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, bool enableDebugInfo, bool prettyDebugInfo, bool printGenericOpForm, bool useLocalScope, bool assumeVerified, py::object fileObject, bool binary, bool skipRegions) |
Implements the bound 'print' method and helps with others. More... | |
void | print (PyAsmState &state, py::object fileObject, bool binary) |
pybind11::object | getAsm (bool binary, std::optional< int64_t > largeElementsLimit, bool enableDebugInfo, bool prettyDebugInfo, bool printGenericOpForm, bool useLocalScope, bool assumeVerified, bool skipRegions) |
void | writeBytecode (const pybind11::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. More... | |
void | moveBefore (PyOperationBase &other) |
bool | verify () |
Verify the operation. More... | |
virtual PyOperation & | getOperation ()=0 |
Each must provide access to the raw Operation. More... | |
Base class for PyOperation and PyOpView which exposes the primary, user visible methods for manipulating it.
Definition at line 571 of file IRModule.h.
|
virtualdefault |
py::object PyOperationBase::getAsm | ( | bool | binary, |
std::optional< int64_t > | largeElementsLimit, | ||
bool | enableDebugInfo, | ||
bool | prettyDebugInfo, | ||
bool | printGenericOpForm, | ||
bool | useLocalScope, | ||
bool | assumeVerified, | ||
bool | skipRegions | ||
) |
Definition at line 1316 of file IRCore.cpp.
References print().
|
pure virtual |
Each must provide access to the raw Operation.
Implemented in mlir::python::PyOpView, and mlir::python::PyOperation.
Referenced by mlir::python::PyMlirContext::clearOperationAndInside(), mlir::python::PyMlirContext::clearOperationsInside(), mlir::python::PySymbolTable::erase(), mlir::python::PySymbolTable::getSymbolName(), mlir::python::PySymbolTable::getVisibility(), mlir::python::PyInsertionPoint::insert(), mlir::python::PySymbolTable::insert(), moveAfter(), moveBefore(), print(), mlir::python::PyAsmState::PyAsmState(), mlir::python::PySymbolTable::PySymbolTable(), mlir::python::PySymbolTable::replaceAllSymbolUses(), mlir::python::PySymbolTable::setSymbolName(), mlir::python::PySymbolTable::setVisibility(), verify(), walk(), mlir::python::PySymbolTable::walkSymbolTables(), and writeBytecode().
void PyOperationBase::moveAfter | ( | PyOperationBase & | other | ) |
Moves the operation before or after the other operation.
Definition at line 1340 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), and mlirOperationMoveAfter().
void PyOperationBase::moveBefore | ( | PyOperationBase & | other | ) |
Definition at line 1349 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), and mlirOperationMoveBefore().
void PyOperationBase::print | ( | PyAsmState & | state, |
py::object | fileObject, | ||
bool | binary | ||
) |
Definition at line 1252 of file IRCore.cpp.
void PyOperationBase::print | ( | std::optional< int64_t > | largeElementsLimit, |
bool | enableDebugInfo, | ||
bool | prettyDebugInfo, | ||
bool | printGenericOpForm, | ||
bool | useLocalScope, | ||
bool | assumeVerified, | ||
py::object | fileObject, | ||
bool | binary, | ||
bool | skipRegions | ||
) |
Implements the bound 'print' method and helps with others.
Definition at line 1221 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), mlir::PyFileAccumulator::getCallback(), getOperation(), mlir::PyFileAccumulator::getUserData(), mlirOperationPrintWithFlags(), mlirOpPrintingFlagsAssumeVerified(), mlirOpPrintingFlagsCreate(), mlirOpPrintingFlagsDestroy(), mlirOpPrintingFlagsElideLargeElementsAttrs(), mlirOpPrintingFlagsEnableDebugInfo(), mlirOpPrintingFlagsPrintGenericOpForm(), mlirOpPrintingFlagsSkipRegions(), and mlirOpPrintingFlagsUseLocalScope().
Referenced by getAsm().
bool PyOperationBase::verify | ( | ) |
Verify the operation.
Throws MLIRError
if verification fails, and returns true
otherwise.
Definition at line 1358 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 1284 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), getOperation(), mlirOperationWalk(), and MlirWalkResultInterrupt.
void PyOperationBase::writeBytecode | ( | const pybind11::object & | fileObject, |
std::optional< int64_t > | bytecodeVersion | ||
) |
Definition at line 1263 of file IRCore.cpp.
References mlir::python::PyOperation::checkValid(), mlir::PyFileAccumulator::getCallback(), getOperation(), mlir::PyFileAccumulator::getUserData(), mlirBytecodeWriterConfigCreate(), mlirBytecodeWriterConfigDesiredEmitVersion(), mlirBytecodeWriterConfigDestroy(), mlirLogicalResultIsFailure(), mlirOperationWriteBytecode(), and mlirOperationWriteBytecodeWithConfig().