the behavior is undefined.
The source memref can be zero-ranked. In that case, the reassociation
- indices must be empty and the the result shape may only consist of unit
+ indices must be empty and the result shape may only consist of unit
dimensions.
For simplicity, this op may not be used to cast dynamicity of dimension
OpBuilder<(ins "ArrayRef<int64_t>":$resultShape, "Value":$src,
"ArrayRef<ReassociationIndices>":$reassociation)>
];
-
- let extraClassDeclaration = commonExtraClassDeclaration # [{
- /// Return `true` if this source MemRef type is guaranteed to be collapsible
- /// according to the given reassociation indices. In the presence of dynamic
- /// strides this is usually not the case.
- static bool isGuaranteedCollapsible(
- MemRefType srcType, ArrayRef<ReassociationIndices> reassociation);
- }];
-
+ let extraClassDeclaration = commonExtraClassDeclaration;
let hasVerifier = 1;
}
build($_builder, $_state, resultType, src, reassociationMaps, attrs);
}]>
];
- let extraClassDeclaration = commonExtraClassDeclaration;
+ let extraClassDeclaration = commonExtraClassDeclaration # [{
+ /// Return `true` if this source MemRef type is guaranteed to be collapsible
+ /// according to the given reassociation indices. In the presence of dynamic
+ /// strides this is usually not the case.
+ static bool isGuaranteedCollapsible(
+ MemRefType srcType, ArrayRef<ReassociationIndices> reassociation);
+ }];
+
let hasVerifier = 1;
}
srcType.getContext());
}
-bool ExpandShapeOp::isGuaranteedCollapsible(
+bool CollapseShapeOp::isGuaranteedCollapsible(
MemRefType srcType, ArrayRef<ReassociationIndices> reassociation) {
// MemRefs with standard layout are always collapsible.
if (srcType.getLayout().isIdentity())
// If the dims are not collapsible (due to an incompatible source layout
// map), force an out-of-place bufferization, i.e., a buffer copy. This
// newly allocated buffer will have no layout map and thus be collapsible.
- bool canBeCollapsed = memref::ExpandShapeOp::isGuaranteedCollapsible(
+ bool canBeCollapsed = memref::CollapseShapeOp::isGuaranteedCollapsible(
bufferType, collapseShapeOp.getReassociationIndices());
Optional<BufferizationState::ForceInPlacability> overrideInPlace =
canBeCollapsed