|
MLIR 22.0.0git
|
An insertion point maintains a pointer to a Block and a reference operation. More...
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
| PyInsertionPoint (const PyBlock &block) | |
| Creates an insertion point positioned after the last operation in the block, but still inside the block. | |
| PyInsertionPoint (PyOperationBase &beforeOperationBase) | |
| Creates an insertion point positioned before a reference operation. | |
| PyInsertionPoint (PyOperationRef beforeOperationRef) | |
| Creates an insertion point positioned before a reference operation. | |
| void | insert (PyOperationBase &operationBase) |
| Inserts an operation. | |
| void | contextExit (const nanobind::object &excType, const nanobind::object &excVal, const nanobind::object &excTb) |
| PyBlock & | getBlock () |
| std::optional< PyOperationRef > & | getRefOperation () |
Static Public Member Functions | |
| static PyInsertionPoint | atBlockBegin (PyBlock &block) |
| Shortcut to create an insertion point at the beginning of the block. | |
| static PyInsertionPoint | atBlockTerminator (PyBlock &block) |
| Shortcut to create an insertion point before the block terminator. | |
| static PyInsertionPoint | after (PyOperationBase &op) |
| Shortcut to create an insertion point to the node after the specified operation. | |
| static nanobind::object | contextEnter (nanobind::object insertionPoint) |
| Enter and exit the context manager. | |
An insertion point maintains a pointer to a Block and a reference operation.
Calls to insert() will insert a new operation before the reference operation. If the reference operation is null, then appends to the end of the block.
Definition at line 837 of file IRModule.h.
| PyInsertionPoint::PyInsertionPoint | ( | const PyBlock & | block | ) |
Creates an insertion point positioned after the last operation in the block, but still inside the block.
Definition at line 1939 of file IRCore.cpp.
Referenced by after(), atBlockBegin(), and atBlockTerminator().
| PyInsertionPoint::PyInsertionPoint | ( | PyOperationBase & | beforeOperationBase | ) |
Creates an insertion point positioned before a reference operation.
Definition at line 1941 of file IRCore.cpp.
References getBlock().
| PyInsertionPoint::PyInsertionPoint | ( | PyOperationRef | beforeOperationRef | ) |
Creates an insertion point positioned before a reference operation.
Definition at line 1945 of file IRCore.cpp.
References getBlock().
|
static |
Shortcut to create an insertion point to the node after the specified operation.
Definition at line 1996 of file IRCore.cpp.
References mlir::python::PyOperation::forOperation(), mlir::python::PyOperation::getBlock(), mlir::python::PyOperationBase::getOperation(), mlirOperationGetNextInBlock(), and PyInsertionPoint().
|
static |
Shortcut to create an insertion point at the beginning of the block.
Definition at line 1974 of file IRCore.cpp.
References mlir::python::PyOperation::forOperation(), mlirBlockGetFirstOperation(), and PyInsertionPoint().
|
static |
Shortcut to create an insertion point before the block terminator.
Definition at line 1987 of file IRCore.cpp.
References mlir::python::PyOperation::forOperation(), mlirBlockGetTerminator(), and PyInsertionPoint().
|
static |
Enter and exit the context manager.
Definition at line 2009 of file IRCore.cpp.
References mlir::python::PyThreadContextEntry::pushInsertionPoint().
| void PyInsertionPoint::contextExit | ( | const nanobind::object & | excType, |
| const nanobind::object & | excVal, | ||
| const nanobind::object & | excTb ) |
Definition at line 2013 of file IRCore.cpp.
References mlir::python::PyThreadContextEntry::popInsertionPoint().
|
inline |
Definition at line 864 of file IRModule.h.
Referenced by PyInsertionPoint(), and PyInsertionPoint().
|
inline |
Definition at line 865 of file IRModule.h.
| void PyInsertionPoint::insert | ( | PyOperationBase & | operationBase | ) |
Inserts an operation.
Definition at line 1948 of file IRCore.cpp.
References mlir::python::PyOperationBase::getOperation(), mlir::python::PyOperation::isAttached(), mlirBlockGetTerminator(), mlirBlockInsertOwnedOperationBefore(), and mlir::python::PyOperation::setAttached().
Referenced by maybeInsertOperation().