[mlir][linalg] Add a builder for `linalg.(indexed_)generic`.

Differential Revision: https://reviews.llvm.org/D81610
This commit is contained in:
Alexander Belyaev 2020-06-10 21:45:18 +02:00
parent 1c3dd7bf37
commit 0f8d40f0d6
1 changed files with 15 additions and 0 deletions

View File

@ -565,6 +565,21 @@ class GenericOpBase<string mnemonic> : LinalgStructuredBase_Op<mnemonic,
"No such thing as reference indexing maps for a generic op.");
}
}];
let builders = [
OpBuilder<"OpBuilder &builder, OperationState &result, "
"ArrayRef<Type> resultTypes, ValueRange args, "
"int64_t inputCount, int64_t outputCount, "
"ArrayRef<AffineMap> indexingMaps, "
"ArrayRef<StringRef> iteratorTypes", [{
return build(builder, result, resultTypes, args,
builder.getI64IntegerAttr(inputCount),
builder.getI64IntegerAttr(outputCount),
builder.getAffineMapArrayAttr(indexingMaps),
builder.getStrArrayAttr(iteratorTypes),
/*doc=*/nullptr, /*library_call=*/nullptr);
}]>];
let printer = [{ return ::print(p, *this); }];
let parser = [{ return ::parseGenericOp(parser, result); }];
}