From 4c46a5d54d87ec3800021c71473145b65ac95fa4 Mon Sep 17 00:00:00 2001 From: Peiming Liu Date: Tue, 6 Sep 2022 16:57:09 +0000 Subject: [PATCH] [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 --- mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td | 2 +- mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp | 2 +- mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp | 2 +- mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td index 9272e2e..5c56f16 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:$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 22cf768..ef32dea 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 d32c33b..022c4be 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(loc, type, values); + return builder.create(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 20ad614..505ae79 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(); - target.addLegalOp(); + target.addLegalOp(); // 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. -- 2.7.4