|
MLIR 22.0.0git
|
#include "mlir/Dialect/MemRef/IR/MemRefMemorySlot.h"#include "mlir/Dialect/MemRef/IR/MemRef.h"#include "mlir/Dialect/UB/IR/UBOps.h"#include "mlir/IR/BuiltinDialect.h"#include "mlir/IR/BuiltinTypes.h"#include "mlir/IR/Matchers.h"#include "mlir/IR/Value.h"#include "mlir/Interfaces/MemorySlotInterfaces.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/TypeSwitch.h"#include "llvm/Support/ErrorHandling.h"Go to the source code of this file.
Functions | |
| static LogicalResult | nextIndex (ArrayRef< int64_t > shape, MutableArrayRef< int64_t > index) |
| Walks over the indices of the elements of a tensor of a given shape by updating index in place to the next index. | |
| template<typename CallableT> | |
| static void | walkIndicesAsAttr (MLIRContext *ctx, ArrayRef< int64_t > shape, CallableT &&walker) |
| Calls walker for each index within a tensor of a given shape, providing the index as an array attribute of the coordinates. | |
| static Attribute | getAttributeIndexFromIndexOperands (MLIRContext *ctx, ValueRange indices, MemRefType memrefType) |
| Returns the index of a memref in attribute form, given its indices. | |
|
static |
Returns the index of a memref in attribute form, given its indices.
Returns a null pointer if whether the indices form a valid index for the provided MemRefType cannot be computed. The indices must come from a valid memref StoreOp or LoadOp.
Definition at line 181 of file MemRefMemorySlot.cpp.
References indices, mlir::m_Constant(), and mlir::matchPattern().
|
static |
Walks over the indices of the elements of a tensor of a given shape by updating index in place to the next index.
This returns failure if the provided index was the last index.
Definition at line 35 of file MemRefMemorySlot.cpp.
References success().
Referenced by walkIndicesAsAttr().
|
static |
Calls walker for each index within a tensor of a given shape, providing the index as an array attribute of the coordinates.
Definition at line 49 of file MemRefMemorySlot.cpp.
References nextIndex().