[Mlir-commits] [mlir] [mlir][sparse] add linalg elt-wise fusion to sparsifier pipeline (PR #90924)

Aart Bik llvmlistbot at llvm.org
Thu May 2 17:45:42 PDT 2024


https://github.com/aartbik created https://github.com/llvm/llvm-project/pull/90924

yields better IR in general, and all end-to-end tests pass!

>From 6f88a5b047da38fa2791f0c46511e3983999355b Mon Sep 17 00:00:00 2001
From: Aart Bik <ajcbik at google.com>
Date: Thu, 2 May 2024 17:43:56 -0700
Subject: [PATCH] [mlir][sparse] add linalg elt-wise fusion to sparsifier
 pipeline

yields better IR in general, and all end-to-end tests pass!
---
 .../Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp b/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
index e58503d508ced4..ab4d90ec745d4a 100644
--- a/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
@@ -31,8 +31,9 @@
 
 void mlir::sparse_tensor::buildSparsifier(OpPassManager &pm,
                                           const SparsifierOptions &options) {
-  // Rewrite named linalg ops into generic ops.
+  // Rewrite named linalg ops into generic ops and apply fusion.
   pm.addNestedPass<func::FuncOp>(createLinalgGeneralizeNamedOpsPass());
+  pm.addNestedPass<func::FuncOp>(createLinalgElementwiseOpFusionPass());
 
   // Sparsification and bufferization mini-pipeline.
   pm.addPass(createSparsificationAndBufferizationPass(



More information about the Mlir-commits mailing list