Skip to content

Commit ae332ff

Browse files
author
git apple-llvm automerger
committed
Merge commit 'a652e5b53a1a' from llvm.org/main into next
2 parents b5b426a + a652e5b commit ae332ff

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ static LogicalResult verify(InitOp op) {
225225
for (unsigned i = 0; i < rank; i++) {
226226
if (shape[i] == ShapedType::kDynamicSize)
227227
continue;
228-
auto constantOp = op.sizes()[i].getDefiningOp<ConstantOp>();
228+
auto constantOp = op.sizes()[i].getDefiningOp<arith::ConstantOp>();
229229
if (!constantOp ||
230-
constantOp.getValue().cast<IntegerAttr>().getInt() != shape[i])
230+
constantOp.value().cast<IntegerAttr>().getInt() != shape[i])
231231
return op.emitError("unexpected mismatch with static dimension size ")
232232
<< shape[i];
233233
}

mlir/test/Dialect/SparseTensor/invalid.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ func @invalid_init_rank(%arg0: index) -> tensor<?xf32, #SparseVector> {
3737
#SparseMatrix = #sparse_tensor.encoding<{dimLevelType = ["compressed", "compressed"]}>
3838

3939
func @invalid_init_size() -> tensor<?x10xf32, #SparseMatrix> {
40-
%c10 = constant 10 : index
41-
%c20 = constant 20 : index
40+
%c10 = arith.constant 10 : index
41+
%c20 = arith.constant 20 : index
4242
// expected-error@+1 {{unexpected mismatch with static dimension size 10}}
4343
%0 = sparse_tensor.init [%c10, %c20] : tensor<?x10xf32, #SparseMatrix>
4444
return %0 : tensor<?x10xf32, #SparseMatrix>

mlir/test/Dialect/SparseTensor/roundtrip.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ func @sparse_new(%arg0: !llvm.ptr<i8>) -> tensor<128xf64, #SparseVector> {
1616
#SparseMatrix = #sparse_tensor.encoding<{dimLevelType = ["compressed", "compressed"]}>
1717

1818
// CHECK-LABEL: func @sparse_init()
19-
// CHECK-DAG: %[[C16:.*]] = constant 16 : index
20-
// CHECK-DAG: %[[C32:.*]] = constant 32 : index
19+
// CHECK-DAG: %[[C16:.*]] = arith.constant 16 : index
20+
// CHECK-DAG: %[[C32:.*]] = arith.constant 32 : index
2121
// CHECK: %[[T:.*]] = sparse_tensor.init[%[[C16]], %[[C32]]] : tensor<?x32xf64, #{{.*}}>
2222
// CHECK: return %[[T]] : tensor<?x32xf64, #{{.*}}>
2323
func @sparse_init() -> tensor<?x32xf64, #SparseMatrix> {
24-
%d1 = constant 16 : index
25-
%d2 = constant 32 : index
24+
%d1 = arith.constant 16 : index
25+
%d2 = arith.constant 32 : index
2626
%0 = sparse_tensor.init [%d1, %d2] : tensor<?x32xf64, #SparseMatrix>
2727
return %0 : tensor<?x32xf64, #SparseMatrix>
2828
}

0 commit comments

Comments
 (0)