20 auto linalgOp = cast<LinalgOp>(op);
21 auto *dialect =
static_cast<LinalgDialect *
>(linalgOp->getDialect());
22 LinalgDialect::RegionBuilderFunType fun =
25 assert(fun &&
"Expected a builtin named Linalg op.");
26 assert(op->
getNumRegions() == 1 &&
"Expected Linalg op with 1 region");
28 "Expected Linalg op with 0 blocks");
32 for (
OpOperand *opOperand : linalgOp.getInputAndOutputOperands()) {
34 argLocs.push_back(opOperand->get().getLoc());
39 Block *body = b.createBlock(®ion, {}, argTypes, argLocs);
40 b.setInsertionPointToStart(body);
Include the generated interface declarations.
This class contains a list of basic blocks and a link to the parent operation it is attached to...
Operation is a basic unit of execution within MLIR.
BlockListType & getBlocks()
unsigned getNumRegions()
Returns the number of regions held by this operation.
Block represents an ordered list of Operations.
ArrayRef< NamedAttribute > getAttrs()
Return all of the attributes on this operation.
MLIRContext * getContext()
Return the context this operation is associated with.
StringRef getStringRef() const
Return the name of this operation. This always succeeds.
void mlirLinalgFillBuiltinNamedOpRegion(MlirOperation mlirOp)
Apply the special region builder for the builtin named Linalg op.
Type getElementTypeOrSelf(Type type)
Return the element type or return the type itself.
Location getLoc()
The source location the operation was defined or derived from.
ImplicitLocOpBuilder maintains a 'current location', allowing use of the create<> method without spec...
This class represents an operand of an operation.
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(SparseTensor, sparse_tensor, mlir::sparse_tensor::SparseTensorDialect) static_assert(static_cast< int >(MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE)
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
OperationName getName()
The name of an operation is the key identifier for it.
Region & getRegion(unsigned index)
Returns the region held by this operation at position 'index'.