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->getOpOperands()) {
34 argLocs.push_back(opOperand.get().getLoc());
void mlirLinalgFillBuiltinNamedOpRegion(MlirOperation mlirOp)
Apply the special region builder for the builtin named Linalg op.
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
Block represents an ordered list of Operations.
ImplicitLocOpBuilder maintains a 'current location', allowing use of the create<> method without spec...
void setInsertionPointToStart(Block *block)
Sets the insertion point to the start of the specified block.
Block * createBlock(Region *parent, Region::iterator insertPt={}, TypeRange argTypes=std::nullopt, ArrayRef< Location > locs=std::nullopt)
Add new block with 'argTypes' arguments and set the insertion point to the end of it.
This class represents an operand of an operation.
StringRef getStringRef() const
Return the name of this operation. This always succeeds.
Operation is the basic unit of execution within MLIR.
MLIRContext * getContext()
Return the context this operation is associated with.
unsigned getNumRegions()
Returns the number of regions held by this operation.
Location getLoc()
The source location the operation was defined or derived from.
ArrayRef< NamedAttribute > getAttrs()
Return all of the attributes on this operation.
Region & getRegion(unsigned index)
Returns the region held by this operation at position 'index'.
OperationName getName()
The name of an operation is the key identifier for it.
This class contains a list of basic blocks and a link to the parent operation it is attached to.
BlockListType & getBlocks()
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Include the generated interface declarations.
Type getElementTypeOrSelf(Type type)
Return the element type or return the type itself.