|
MLIR 24.0.0git
|
Class used for convenient access and iteration over GEP indices. More...
#include "mlir/Dialect/LLVMIR/LLVMMemoryOps.h"
Classes | |
| class | iterator |
Public Types | |
| using | value_type |
| Return type of 'operator[]' and the iterators 'operator*'. | |
Public Member Functions | |
| GEPIndicesAdaptor (DenseI32ArrayAttr rawConstantIndices, DynamicRange values) | |
| Constructs a GEPIndicesAdaptor with the raw constant indices of a GEPOp and the range that is indexed into for retrieving dynamic indices. | |
| value_type | operator[] (size_t index) const |
| Returns the GEP index at the given position. | |
| bool | isDynamicIndex (size_t index) const |
| Returns whether the GEP index at the given position is a dynamic index. | |
| size_t | size () const |
| Returns the amount of indices of the GEPOp. | |
| bool | empty () const |
| Returns true if this GEPOp does not have any indices. | |
| iterator | begin () const |
| Returns the begin iterator, iterating over all GEP indices. | |
| iterator | end () const |
| Returns the end iterator, iterating over all GEP indices. | |
Class used for convenient access and iteration over GEP indices.
This class is templated to support not only retrieving the dynamic operands of a GEP operation, but also as an adaptor during folding or conversion to LLVM IR.
GEP indices may either be constant indices or dynamic indices. The 'rawConstantIndices' is specially encoded by GEPOp and contains either the constant index or the information that an index is a dynamic index.
When an access to such an index is made it is done through the 'DynamicRange' of this class. This way it can be used as getter in GEPOp via 'GEPIndicesAdaptor<ValueRange>' or during folding via 'GEPIndicesAdaptor<ArrayRef<Attribute>>'.
Definition at line 70 of file LLVMMemoryOps.h.
| using mlir::LLVM::GEPIndicesAdaptor< DynamicRange >::value_type |
Return type of 'operator[]' and the iterators 'operator*'.
It is depended upon the value type of 'DynamicRange'. If 'DynamicRange' contains Attributes or subclasses thereof, then value_type is 'Attribute'. In all other cases it is a pointer union between the value type of 'DynamicRange' and IntegerAttr.
Definition at line 77 of file LLVMMemoryOps.h.
|
inline |
Constructs a GEPIndicesAdaptor with the raw constant indices of a GEPOp and the range that is indexed into for retrieving dynamic indices.
Definition at line 85 of file LLVMMemoryOps.h.
Referenced by mlir::LLVM::GEPIndicesAdaptor< DynamicRange >::iterator::iterator().
|
inline |
Returns the begin iterator, iterating over all GEP indices.
Definition at line 147 of file LLVMMemoryOps.h.
Referenced by operator[]().
|
inline |
Returns true if this GEPOp does not have any indices.
Definition at line 107 of file LLVMMemoryOps.h.
|
inline |
Returns the end iterator, iterating over all GEP indices.
Definition at line 153 of file LLVMMemoryOps.h.
|
inline |
Returns whether the GEP index at the given position is a dynamic index.
Definition at line 99 of file LLVMMemoryOps.h.
|
inline |
Returns the GEP index at the given position.
Note that this operation has a linear complexity in regards to the accessed position. To iterate over all indices, use the iterators.
This operation is invalid if the index is out of bounds.
Definition at line 93 of file LLVMMemoryOps.h.
|
inline |
Returns the amount of indices of the GEPOp.
Definition at line 104 of file LLVMMemoryOps.h.
Referenced by operator[]().