Changeset View
Changeset View
Standalone View
Standalone View
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
Show First 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | |||||
/// FillOp region is elided when printing. | /// FillOp region is elided when printing. | ||||
void printFillOpRegion(OpAsmPrinter &, Operation *, Region &, Type, Type) {} | void printFillOpRegion(OpAsmPrinter &, Operation *, Region &, Type, Type) {} | ||||
static LogicalResult verify(FillOp op) { | static LogicalResult verify(FillOp op) { | ||||
OpOperand *output = op.getOutputOperand(0); | OpOperand *output = op.getOutputOperand(0); | ||||
Type fillType = op.value().getType(); | Type fillType = op.value().getType(); | ||||
if (getElementTypeOrSelf(output->get()) != fillType) | if (getElementTypeOrSelf(output->get()) != fillType) | ||||
return op.emitOpError("expects fill type to match view elemental type"); | return op.emitOpError("expects fill type to match view elemental type"); | ||||
if (!op.getNumResults() && !output->get().getType().isa<MemRefType>()) { | |||||
return op.emitOpError( | |||||
"expected fill op with no result value to use memref type"); | |||||
} | |||||
return success(); | return success(); | ||||
} | } | ||||
void FillOp::getEffects( | void FillOp::getEffects( | ||||
SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>> | SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>> | ||||
&effects) { | &effects) { | ||||
if (output().getType().isa<MemRefType>()) | if (output().getType().isa<MemRefType>()) | ||||
effects.emplace_back(MemoryEffects::Write::get(), output(), | effects.emplace_back(MemoryEffects::Write::get(), output(), | ||||
▲ Show 20 Lines • Show All 2,401 Lines • Show Last 20 Lines |