[mlir][sparse] replace experimental flag with inplace attribute

The experimental flag for "inplace" bufferization in the sparse
compiler can be replaced with the new inplace attribute. This gives
a uniform way of expressing the more efficient way of bufferization.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D102538
This commit is contained in:
Aart Bik
2021-05-14 21:02:31 -07:00
parent 4a12248ee2
commit 5879da496c
6 changed files with 150 additions and 52 deletions

View File

@@ -45,10 +45,6 @@ struct SparsificationPass : public SparsificationBase<SparsificationPass> {
Option<int32_t> vectorLength{
*this, "vl", llvm::cl::desc("Set the vector length"), llvm::cl::init(1)};
Option<bool> fastOutput{*this, "fast-output",
llvm::cl::desc("Allows fast output buffers"),
llvm::cl::init(false)};
/// Returns parallelization strategy given on command line.
SparseParallelizationStrategy parallelOption() {
switch (parallelization) {
@@ -82,7 +78,7 @@ struct SparsificationPass : public SparsificationBase<SparsificationPass> {
RewritePatternSet patterns(ctx);
// Translate strategy flags to strategy options.
SparsificationOptions options(parallelOption(), vectorOption(),
vectorLength, fastOutput);
vectorLength);
// Apply rewriting.
populateSparsificationPatterns(patterns, options);
vector::populateVectorToVectorCanonicalizationPatterns(patterns);