kInplaceableAttrName = "linalg.inplaceable";
/// Attribute name used to mark the bufferization layout for region
- // arguments during linalg comprehensive bufferization.
+ /// arguments during linalg comprehensive bufferization.
constexpr const static ::llvm::StringLiteral
kBufferLayoutAttrName = "linalg.buffer_layout";
constexpr const ::llvm::StringLiteral
LinalgDialect::kMemoizedIndexingMapsAttrName;
+/// Attribute name used to mark the bufferization layout for region
+/// arguments during linalg comprehensive bufferization.
+constexpr const ::llvm::StringLiteral LinalgDialect::kBufferLayoutAttrName;
+
/// Attribute name used to mark region arguments that can be bufferized
/// in-place during linalg comprehensive bufferization.
constexpr const ::llvm::StringLiteral LinalgDialect::kInplaceableAttrName;
<< " to be used on function-like operations";
return success();
}
+ if (attr.first == LinalgDialect::kBufferLayoutAttrName) {
+ if (!attr.second.isa<AffineMapAttr>()) {
+ return op->emitError() << "'" << LinalgDialect::kBufferLayoutAttrName
+ << "' is expected to be a affine map attribute";
+ }
+ if (!op->hasTrait<OpTrait::FunctionLike>())
+ return op->emitError() << "expected " << attr.first
+ << " to be used on function-like operations";
+ return success();
+ }
if (attr.first == LinalgDialect::kMemoizedIndexingMapsAttrName)
return success();
return op->emitError() << "attribute '" << attr.first