[Mlir-commits] [mlir] 4c46a5d - [mlir][sparse] Refactoring: renaming StorageNewOp to StorageOp
Peiming Liu
llvmlistbot at llvm.org
Tue Sep 6 10:02:34 PDT 2022
Author: Peiming Liu
Date: 2022-09-06T17:02:25Z
New Revision: 4c46a5d54d87ec3800021c71473145b65ac95fa4
URL: https://github.com/llvm/llvm-project/commit/4c46a5d54d87ec3800021c71473145b65ac95fa4
DIFF: https://github.com/llvm/llvm-project/commit/4c46a5d54d87ec3800021c71473145b65ac95fa4.diff
LOG: [mlir][sparse] Refactoring: renaming StorageNewOp to StorageOp
To address comment in https://reviews.llvm.org/D133241
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D133363
Added:
Modified:
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
index 9272e2e90d54a..5c56f16d71ee8 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
@@ -629,7 +629,7 @@ def SparseTensor_YieldOp : SparseTensor_Op<"yield", [NoSideEffect, Terminator]>,
// sparse tensor codegen to progressively lower sparse tensors.
//===----------------------------------------------------------------------===//
-def SparseTensor_StorageNewOp : SparseTensor_Op<"storage", []>,
+def SparseTensor_StorageOp : SparseTensor_Op<"storage", []>,
Arguments<(ins Variadic<AnyType>:$inputs)>,
Results<(outs AnyTuple:$result)> {
let summary = "Pack a list of value into one sparse tensor storage value";
diff --git a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
index 22cf768316f98..ef32dea8efff2 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
@@ -486,7 +486,7 @@ LogicalResult YieldOp::verify() {
// Sparse Tensor Storage Operation.
//===----------------------------------------------------------------------===//
-LogicalResult StorageNewOp::verify() {
+LogicalResult StorageOp::verify() {
auto retTypes = getResult().getType().getTypes();
if (retTypes.size() != getInputs().size())
return emitError("The number of inputs is inconsistent with output tuple");
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
index d32c33b3fde8c..022c4be443a0a 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
@@ -174,7 +174,7 @@ static Value createTupleGet(OpBuilder &builder, Location loc, Value tuple,
/// Creates tuple.
static Value createTupleMake(OpBuilder &builder, Location loc, Type type,
ValueRange values) {
- return builder.create<StorageNewOp>(loc, type, values);
+ return builder.create<StorageOp>(loc, type, values);
}
/// Create allocation operation.
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
index 20ad614450b59..505ae79e26fac 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
@@ -156,7 +156,7 @@ struct SparseTensorCodegenPass
ConversionTarget target(*ctx);
// Almost everything in the sparse dialect must go!
target.addIllegalDialect<SparseTensorDialect>();
- target.addLegalOp<StorageGetOp, StorageSetOp, StorageNewOp>();
+ target.addLegalOp<StorageGetOp, StorageSetOp, StorageOp>();
// All dynamic rules below accept new function, call, return, and various
// tensor and bufferization operations as legal output of the rewriting
// provided that all sparse tensor types have been fully rewritten.
More information about the Mlir-commits
mailing list