[Mlir-commits] [mlir] c3821e1 - [mlir][sparse] fix bugs in concatenate rewriter.

Peiming Liu llvmlistbot at llvm.org
Tue Nov 15 11:50:06 PST 2022


Author: Peiming Liu
Date: 2022-11-15T19:49:59Z
New Revision: c3821e1684c89c7f10eecfd30763a86b2738ed65

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

LOG: [mlir][sparse] fix bugs in concatenate rewriter.

Reviewed By: aartbik, bixia

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

Added: 
    

Modified: 
    mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
index d6f5bded2e86..debaf0946936 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
@@ -456,9 +456,7 @@ struct ConcatenateRewriter : public OpRewritePattern<ConcatenateOp> {
               ValueRange reduc) {
             SmallVector<Value, 4> indices;
             for (int64_t i = 0; i < rank; i++) {
-              uint64_t dim =
-                  toStoredDim(getSparseTensorEncoding(input.getType()), i);
-              Value idx = args[dim];
+              Value idx = args[i];
               if (i == static_cast<int64_t>(conDim))
                 // transform coordinates on matching dim
                 idx = builder.create<arith::AddIOp>(loc, idx, offset);


        


More information about the Mlir-commits mailing list