// CopyOp
//===----------------------------------------------------------------------===//
-def CopyOp : MemRef_Op<"copy", [CopyOpInterface, SameOperandsElementType,
+def CopyOp : MemRef_Op<"copy", [CopyOpInterface, SameOperandsElementType,
SameOperandsShape]> {
let description = [{
// ExtractAlignedPointerAsIndexOp
//===----------------------------------------------------------------------===//
-def MemRef_ExtractAlignedPointerAsIndexOp :
+def MemRef_ExtractAlignedPointerAsIndexOp :
MemRef_Op<"extract_aligned_pointer_as_index", [
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
- Pure,
+ Pure,
SameVariadicResultSize]> {
let summary = "Extracts a memref's underlying aligned pointer as an index";
let description = [{
def MemRef_ExtractStridedMetadataOp : MemRef_Op<"extract_strided_metadata", [
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
- Pure,
+ Pure,
SameVariadicResultSize,
DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
let summary = "Extracts a buffer base with offset and strides";
This operation is also useful for completeness to the existing memref.dim op.
While accessing strides, offsets and the base pointer independently is not
- available, this is useful for composing with its natural complement op:
+ available, this is useful for composing with its natural complement op:
`memref.reinterpret_cast`.
Intended Use Cases:
The main use case is to expose the logic for manipulate memref metadata at a
- higher level than the LLVM dialect.
+ higher level than the LLVM dialect.
This makes lowering more progressive and brings the following benefits:
- not all users of MLIR want to lower to LLVM and the information to e.g.
lower to library calls---like libxsmm---or to SPIR-V was not available.
- - foldings and canonicalizations can happen at a higher level in MLIR:
- before this op existed, lowering to LLVM would create large amounts of
+ - foldings and canonicalizations can happen at a higher level in MLIR:
+ before this op existed, lowering to LLVM would create large amounts of
LLVMIR. Even when LLVM does a good job at folding the low-level IR from
a performance perspective, it is unnecessarily opaque and inefficient to
send unkempt IR to LLVM.
Example:
```mlir
- %base, %offset, %sizes:2, %strides:2 =
- memref.extract_strided_metadata %memref :
+ %base, %offset, %sizes:2, %strides:2 =
+ memref.extract_strided_metadata %memref :
memref<10x?xf32>, index, index, index, index, index
- // After folding, the type of %m2 can be memref<10x?xf32> and further
+ // After folding, the type of %m2 can be memref<10x?xf32> and further
// folded to %memref.
%m2 = memref.reinterpret_cast %base to
offset: [%offset],
def MemRef_ReinterpretCastOp
: MemRef_OpWithOffsetSizesAndStrides<"reinterpret_cast", [
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
- AttrSizedOperandSegments,
+ AttrSizedOperandSegments,
MemRefsNormalizable,
- Pure,
- OffsetSizeAndStrideOpInterface,
+ Pure,
+ OffsetSizeAndStrideOpInterface,
ViewLikeOpInterface
]> {
let summary = "memref reinterpret cast operation";
def MemRef_ViewOp : MemRef_Op<"view", [
DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>,
- DeclareOpInterfaceMethods<ViewLikeOpInterface>,
+ DeclareOpInterfaceMethods<ViewLikeOpInterface>,
Pure]> {
let summary = "memref view operation";
let description = [{