MLIR 23.0.0git
IndexedAccessOpInterfaceImpl.cpp File Reference

Go to the source code of this file.

Functions

template<typename LoadStoreOp>
static bool hasMemrefSemantics (Operation *op)
 Return true if this op has the memref semantics expected by this model.
template<typename LoadStoreOp>
static constexpr bool supportsRankZeroVectorAccess ()
 Return true if this op supports rank-0 vector operands/results.
static unsigned getNumLeadingUnitDims (VectorType vecTy)
 Return the number of leading static unit dimensions in vecTy.
static SmallVector< int64_tgetAccessedVectorShape (VectorType vecTy, bool supportsRankZero)
 Return the vector shape whose access strides must be preserved, omitting redundant leading static unit dimensions and marking scalable dimensions as dynamic.
static VectorType dropLeadingDims (VectorType vecTy, unsigned numLeadingDims)
 Return vecTy with numLeadingDims dimensions dropped from the front.
static std::optional< VectorType > getShapeCastTypeForOperand (Value operand, VectorType vecTy, unsigned numLeadingDims)
 Return the shape-cast type for vector operands that match vecTy.

Function Documentation

◆ dropLeadingDims()

VectorType dropLeadingDims ( VectorType vecTy,
unsigned numLeadingDims )
static

Return vecTy with numLeadingDims dimensions dropped from the front.

Definition at line 77 of file IndexedAccessOpInterfaceImpl.cpp.

Referenced by getShapeCastTypeForOperand().

◆ getAccessedVectorShape()

SmallVector< int64_t > getAccessedVectorShape ( VectorType vecTy,
bool supportsRankZero )
static

Return the vector shape whose access strides must be preserved, omitting redundant leading static unit dimensions and marking scalable dimensions as dynamic.

If the op cannot access rank-0 vectors, preserve one trailing unit dimension instead of returning an empty shape.

Definition at line 61 of file IndexedAccessOpInterfaceImpl.cpp.

References getNumLeadingUnitDims().

◆ getNumLeadingUnitDims()

unsigned getNumLeadingUnitDims ( VectorType vecTy)
static

Return the number of leading static unit dimensions in vecTy.

Definition at line 46 of file IndexedAccessOpInterfaceImpl.cpp.

Referenced by getAccessedVectorShape().

◆ getShapeCastTypeForOperand()

std::optional< VectorType > getShapeCastTypeForOperand ( Value operand,
VectorType vecTy,
unsigned numLeadingDims )
static

Return the shape-cast type for vector operands that match vecTy.

Definition at line 85 of file IndexedAccessOpInterfaceImpl.cpp.

References dropLeadingDims(), and mlir::Value::getType().

◆ hasMemrefSemantics()

template<typename LoadStoreOp>
bool hasMemrefSemantics ( Operation * op)
static

Return true if this op has the memref semantics expected by this model.

Definition at line 34 of file IndexedAccessOpInterfaceImpl.cpp.

References getBase(), and mlir::getType().

◆ supportsRankZeroVectorAccess()

template<typename LoadStoreOp>
constexpr bool supportsRankZeroVectorAccess ( )
staticconstexpr

Return true if this op supports rank-0 vector operands/results.

Definition at line 40 of file IndexedAccessOpInterfaceImpl.cpp.