Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | let methods = [ | ||||
>, | >, | ||||
InterfaceMethod<[{ | InterfaceMethod<[{ | ||||
Clone the current operation with the given location and operands. This | Clone the current operation with the given location and operands. This | ||||
is used to abstract away the optional underlying region creation. | is used to abstract away the optional underlying region creation. | ||||
}], | }], | ||||
"Operation *", "clone", | "Operation *", "clone", | ||||
(ins "OpBuilder &":$b, "Location":$loc, "ValueRange":$operands), [{ | (ins "OpBuilder &":$b, "Location":$loc, "ValueRange":$operands), [{ | ||||
BlockAndValueMapping map; | BlockAndValueMapping map; | ||||
unsigned numRegions = op.getOperation()->getNumRegions(); | unsigned numRegions = $_op.getOperation()->getNumRegions(); | ||||
Operation *res = create(b, loc, operands, op.getAttrs()); | Operation *res = create(b, loc, operands, $_op.getAttrs()); | ||||
assert(res->getNumRegions() == numRegions && "inconsistent # regions"); | assert(res->getNumRegions() == numRegions && "inconsistent # regions"); | ||||
for (unsigned ridx = 0; ridx < numRegions; ++ridx) | for (unsigned ridx = 0; ridx < numRegions; ++ridx) | ||||
op.getOperation()->getRegion(ridx).cloneInto( | $_op.getOperation()->getRegion(ridx).cloneInto( | ||||
&res->getRegion(ridx), map); | &res->getRegion(ridx), map); | ||||
return res; | return res; | ||||
}] | }] | ||||
> | > | ||||
]; | ]; | ||||
} | } | ||||
#endif // LINALG_IR_STRUCTURED_OPS_INTERFACE | #endif // LINALG_IR_STRUCTURED_OPS_INTERFACE |