[mlir][linalg] enable library call rewrites for linalg operations with index semantics.

The patch enables the library call lowering for linalg operations that contain index operations.

Differential Revision: https://reviews.llvm.org/D100537
This commit is contained in:
Tobias Gysi 2021-04-19 12:23:11 +00:00
parent 4acd8457d8
commit 27ad213680
2 changed files with 3 additions and 5 deletions

View File

@ -29,7 +29,7 @@ namespace linalg {
// function. The implementation of the function can be either in the same module
// or in an externally linked library.
// This is a generic entry point for all LinalgOp, except for CopyOp and
// IndexedGenericOp, for which omre specialized patterns are provided.
// IndexedGenericOp, for which more specialized patterns are provided.
class LinalgOpToLibraryCallRewrite
: public OpInterfaceRewritePattern<LinalgOp> {
public:

View File

@ -106,14 +106,12 @@ LogicalResult mlir::linalg::LinalgOpToLibraryCallRewrite::matchAndRewrite(
if (isa<CopyOp>(op) || isa<IndexedGenericOp>(op))
return failure();
// TODO: remove once index ops are supported.
if (op.hasIndexSemantics())
return failure();
auto libraryCallName = getLibraryCallSymbolRef(op, rewriter);
if (!libraryCallName)
return failure();
// TODO: Add support for more complex library call signatures that include
// indices or captured values.
rewriter.replaceOpWithNewOp<mlir::CallOp>(
op, libraryCallName.getValue(), TypeRange(),
createTypeCanonicalizedMemRefOperands(rewriter, op->getLoc(),