|
MLIR 22.0.0git
|
A list of block predecessors. More...
#include "mlir/Bindings/Python/IRCore.h"
Public Member Functions | |
| PyBlockPredecessors (PyBlock block, PyOperationRef operation, intptr_t startIndex=0, intptr_t length=-1, intptr_t step=1) | |
| Public Member Functions inherited from mlir::Sliceable< PyBlockPredecessors, PyBlock > | |
| Sliceable (intptr_t startIndex, intptr_t length, intptr_t step) | |
| PyBlock | getElement (intptr_t index) |
| Returns the index-th element in the slice, supports negative indices. | |
| intptr_t | size () |
| Returns the size of slice. | |
| std::vector< PyBlock > | dunderAdd (PyBlockPredecessors &other) |
| Returns a new vector (mapped to Python list) containing elements from two slices. | |
Static Public Attributes | |
| static constexpr const char * | pyClassName = "BlockPredecessors" |
Friends | |
| class | Sliceable< PyBlockPredecessors, PyBlock > |
| Give the parent CRTP class access to hook implementations below. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from mlir::Sliceable< PyBlockPredecessors, PyBlock > | |
| static void | bind (nanobind::module_ &m) |
| Binds the indexing and length methods in the Python class. | |
| static void | bindDerived (ClassTy &) |
| Hook for derived classes willing to bind more methods. | |
| Public Attributes inherited from mlir::Sliceable< PyBlockPredecessors, PyBlock > | |
| intptr_t | startIndex |
| intptr_t | length |
| intptr_t | step |
| Protected Types inherited from mlir::Sliceable< PyBlockPredecessors, PyBlock > | |
| using | ClassTy |
| using | has_maybe_downcast |
| Trait to check if T provides a maybeDownCast method. | |
| Protected Member Functions inherited from mlir::Sliceable< PyBlockPredecessors, PyBlock > | |
| intptr_t | wrapIndex (intptr_t index) |
| Transforms index into a legal value to access the underlying sequence. | |
| intptr_t | linearizeIndex (intptr_t index) |
| Computes the linear index given the current slice properties. | |
| nanobind::object | getItem (intptr_t index) |
| Returns the element at the given slice index. | |
| nanobind::object | getItemSlice (PyObject *slice) |
| Returns a new instance of the pseudo-container restricted to the given slice. | |
A list of block predecessors.
The (returned) predecessor list is associated with the operation and block whose predecessors these are, and thus extends the lifetime of this operation and block.
WARNING: This Sliceable is more expensive than the others here because mlirBlockGetPredecessor actually iterates the use-def chain (of block operands) anew for each indexed access.
| mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockPredecessors::PyBlockPredecessors | ( | PyBlock | block, |
| PyOperationRef | operation, | ||
| intptr_t | startIndex = 0, | ||
| intptr_t | length = -1, | ||
| intptr_t | step = 1 ) |
Definition at line 2350 of file IRCore.cpp.
References mlir::Sliceable< PyBlockPredecessors, PyBlock >::length, mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockSuccessors::PyBlockSuccessors(), mlir::Sliceable< PyBlockPredecessors, PyBlock >::startIndex, and mlir::Sliceable< PyBlockPredecessors, PyBlock >::step.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpAttributeMap::dunderGetItemNamed(), and Sliceable< PyBlockPredecessors, PyBlock >.
|
friend |
Give the parent CRTP class access to hook implementations below.
Definition at line 1773 of file IRCore.h.
References mlir::Sliceable< PyBlockPredecessors, PyBlock >::length, PyBlockPredecessors(), mlir::Sliceable< PyBlockPredecessors, PyBlock >::Sliceable(), mlir::Sliceable< PyBlockPredecessors, PyBlock >::startIndex, and mlir::Sliceable< PyBlockPredecessors, PyBlock >::step.
|
staticconstexpr |