[Mlir-commits] [mlir] 27ad213 - [mlir][linalg] enable library call rewrites for linalg operations with index semantics.

Tobias Gysi llvmlistbot at llvm.org
Mon Apr 19 05:52:53 PDT 2021


Author: Tobias Gysi
Date: 2021-04-19T12:50:59Z
New Revision: 27ad213680eae7aa75dd6dd72608957cac9198f2

URL: https://github.com/llvm/llvm-project/commit/27ad213680eae7aa75dd6dd72608957cac9198f2
DIFF: https://github.com/llvm/llvm-project/commit/27ad213680eae7aa75dd6dd72608957cac9198f2.diff

LOG: [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

Added: 
    

Modified: 
    mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
    mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h b/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
index eeb20c4806b9d..d3172537a1cb3 100644
--- a/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
+++ b/mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
@@ -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:

diff  --git a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
index d385b46848df9..dd4fafb8c9870 100644
--- a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
+++ b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
@@ -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(),


        


More information about the Mlir-commits mailing list