MLIR 22.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase Class Referenceabstract

Base class for PyOperation and PyOpView which exposes the primary, user visible methods for manipulating it. More...

#include "mlir/Bindings/Python/IRCore.h"

Inheritance diagram for mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase:

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< PyWalkResult(MlirOperation)> callback, PyWalkOrder 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 PyOperationgetOperation ()=0
 Each must provide access to the raw Operation.

Detailed Description

Base class for PyOperation and PyOpView which exposes the primary, user visible methods for manipulating it.

Definition at line 579 of file IRCore.h.

Constructor & Destructor Documentation

◆ ~PyOperationBase()

virtual mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::~PyOperationBase ( )
virtualdefault

Member Function Documentation

◆ getAsm()

nb::object mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::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 )

◆ getOperation()

◆ isBeforeInBlock()

bool mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::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 1181 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore(), and ~PyOperationBase().

◆ moveAfter()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::moveAfter ( PyOperationBase & other)

Moves the operation before or after the other operation.

Definition at line 1163 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore(), and ~PyOperationBase().

◆ moveBefore()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::moveBefore ( PyOperationBase & other)

◆ print() [1/2]

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::print ( PyAsmState & state,
nanobind::object fileObject,
bool binary )

Definition at line 1070 of file IRCore.cpp.

◆ print() [2/2]

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::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.

Definition at line 1033 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ verify()

bool mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::verify ( )

Verify the operation.

Throws MLIRError if verification fails, and returns true otherwise.

Definition at line 1189 of file IRCore.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore(), and ~PyOperationBase().

◆ walk()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::walk ( std::function< PyWalkResult(MlirOperation)> callback,
PyWalkOrder walkOrder )

◆ writeBytecode()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOperationBase::writeBytecode ( const nanobind::object & fileObject,
std::optional< int64_t > bytecodeVersion )

The documentation for this class was generated from the following files: