MLIR 24.0.0git
MemorySlotOpInterfaceImpl.cpp File Reference

Go to the source code of this file.

Functions

static bool isWholeBufferTransfer (VectorTransferOpInterface xferOp, const MemorySlot &slot, const SmallPtrSetImpl< OpOperand * > &blockingUses)
 Returns whether xferOp accesses exactly the whole contents of slot, so it can act as a plain whole-buffer load/store during Mem2Reg.
static std::optional< SmallVector< int64_t > > getPromotableSubViewOffsets (memref::SubViewOp subView)
 Returns the offsets of subView as a static, contiguous, same-rank slice of its source, or nullopt if the subview is not promotable as a whole-buffer sub-slice.

Function Documentation

◆ getPromotableSubViewOffsets()

std::optional< SmallVector< int64_t > > getPromotableSubViewOffsets ( memref::SubViewOp subView)
static

Returns the offsets of subView as a static, contiguous, same-rank slice of its source, or nullopt if the subview is not promotable as a whole-buffer sub-slice.

Promotion projects the parent buffer's vector value through vector.extract_strided_slice / insert_strided_slice, which require:

  • fully static offsets and sizes,
  • unit strides,
  • no rank reduction (result rank == source rank), so a dropped or dynamic dimension disqualifies the subview.

Definition at line 181 of file MemorySlotOpInterfaceImpl.cpp.

References mlir::getConstantIntValue().

◆ isWholeBufferTransfer()

bool isWholeBufferTransfer ( VectorTransferOpInterface xferOp,
const MemorySlot & slot,
const SmallPtrSetImpl< OpOperand * > & blockingUses )
static

Returns whether xferOp accesses exactly the whole contents of slot, so it can act as a plain whole-buffer load/store during Mem2Reg.

Definition at line 51 of file MemorySlotOpInterfaceImpl.cpp.

References mlir::MemorySlot::elemType, mlir::getConstantIntValue(), and mlir::MemorySlot::ptr.