[Mlir-commits] [mlir] [mlir][sparse] remove unused COO method (PR #73595)

Aart Bik llvmlistbot at llvm.org
Mon Nov 27 16:58:46 PST 2023


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

step closer towards moving all type related methods into encoding and/or sparse tensor type class

>From 8edff0bef85a6c5645871b32cf9c185b37b7c048 Mon Sep 17 00:00:00 2001
From: Aart Bik <ajcbik at google.com>
Date: Mon, 27 Nov 2023 16:57:26 -0800
Subject: [PATCH] [mlir][sparse] remove unused COO method

step closer towards moving all type related methods
into encoding and/or sparse tensor type class
---
 mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h | 4 +---
 mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp | 9 +--------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h
index f102f0270154264..517c286e0206997 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h
@@ -102,12 +102,10 @@ bool isUniqueCOOType(Type tp);
 /// the level-rank.
 Level getCOOStart(SparseTensorEncodingAttr enc);
 
-/// Helpers to setup a COO type.
+/// Helper to setup a COO type.
 RankedTensorType getCOOFromTypeWithOrdering(RankedTensorType src,
                                             AffineMap ordering, bool ordered);
 
-RankedTensorType getCOOFromType(RankedTensorType src, bool ordered);
-
 /// Returns true iff MLIR operand has any sparse operand.
 inline bool hasAnySparseOperand(Operation *op) {
   return llvm::any_of(op->getOperands().getTypes(), [](Type t) {
diff --git a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
index c4a828a20465a80..ff2930008fa093f 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
@@ -878,7 +878,7 @@ Level mlir::sparse_tensor::getCOOStart(SparseTensorEncodingAttr enc) {
   return lvlRank;
 }
 
-// Helpers to setup a COO type.
+// Helper to setup a COO type.
 RankedTensorType sparse_tensor::getCOOFromTypeWithOrdering(RankedTensorType rtt,
                                                            AffineMap lvlPerm,
                                                            bool ordered) {
@@ -911,13 +911,6 @@ RankedTensorType sparse_tensor::getCOOFromTypeWithOrdering(RankedTensorType rtt,
   return RankedTensorType::get(src.getDimShape(), src.getElementType(), enc);
 }
 
-RankedTensorType sparse_tensor::getCOOFromType(RankedTensorType src,
-                                               bool ordered) {
-  return getCOOFromTypeWithOrdering(
-      src, AffineMap::getMultiDimIdentityMap(src.getRank(), src.getContext()),
-      ordered);
-}
-
 Dimension mlir::sparse_tensor::toDim(SparseTensorEncodingAttr enc, Level l) {
   if (enc) {
     assert(enc.isPermutation() && "Non permutation map not supported");



More information about the Mlir-commits mailing list