[mlir][sparse] avoid single default parameters in pass constructors
authorAart Bik <ajcbik@google.com>
Tue, 15 Nov 2022 19:47:53 +0000 (11:47 -0800)
committerAart Bik <ajcbik@google.com>
Tue, 15 Nov 2022 21:07:54 +0000 (13:07 -0800)
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D138054

mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp

index 19ff2eb..badc3d0 100644 (file)
@@ -133,8 +133,9 @@ void populateSparseTensorCodegenPatterns(TypeConverter &typeConverter,
                                          RewritePatternSet &patterns,
                                          bool enableBufferInitialization);
 
+std::unique_ptr<Pass> createSparseTensorCodegenPass();
 std::unique_ptr<Pass>
-createSparseTensorCodegenPass(bool enableBufferInitialization = false);
+createSparseTensorCodegenPass(bool enableBufferInitialization);
 
 //===----------------------------------------------------------------------===//
 // The SparseTensorRewriting pass.
@@ -157,8 +158,10 @@ std::unique_ptr<Pass> createDenseBufferizationPass(
 
 void populateSparseBufferRewriting(RewritePatternSet &patterns,
                                    bool enableBufferInitialization);
+
+std::unique_ptr<Pass> createSparseBufferRewritePass();
 std::unique_ptr<Pass>
-createSparseBufferRewritePass(bool enableBufferInitialization = false);
+createSparseBufferRewritePass(bool enableBufferInitialization);
 
 //===----------------------------------------------------------------------===//
 // Registration.
index c153dcd..da7c6ff 100644 (file)
@@ -283,11 +283,19 @@ std::unique_ptr<Pass> mlir::createSparseTensorConversionPass(
   return std::make_unique<SparseTensorConversionPass>(options);
 }
 
+std::unique_ptr<Pass> mlir::createSparseTensorCodegenPass() {
+  return std::make_unique<SparseTensorCodegenPass>();
+}
+
 std::unique_ptr<Pass>
 mlir::createSparseTensorCodegenPass(bool enableBufferInitialization) {
   return std::make_unique<SparseTensorCodegenPass>(enableBufferInitialization);
 }
 
+std::unique_ptr<Pass> mlir::createSparseBufferRewritePass() {
+  return std::make_unique<SparseBufferRewritePass>();
+}
+
 std::unique_ptr<Pass>
 mlir::createSparseBufferRewritePass(bool enableBufferInitialization) {
   return std::make_unique<SparseBufferRewritePass>(enableBufferInitialization);