diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp --- a/mlir/lib/IR/AsmPrinter.cpp +++ b/mlir/lib/IR/AsmPrinter.cpp @@ -1607,7 +1607,7 @@ // accept the string "elided". The first string must be a registered dialect // name and the latter must be a hex constant. static void printElidedElementsAttr(raw_ostream &os) { - os << R"(opaque<"_", "0xDEADBEEF">)"; + os << R"(opaque<"elided_large_const", "0xDEADBEEF">)"; } LogicalResult AsmPrinter::Impl::printAlias(Attribute attr) { diff --git a/mlir/test/CAPI/ir.c b/mlir/test/CAPI/ir.c --- a/mlir/test/CAPI/ir.c +++ b/mlir/test/CAPI/ir.c @@ -463,7 +463,7 @@ mlirOperationPrintWithFlags(operation, flags, printToStderr, NULL); fprintf(stderr, "\n"); // clang-format off - // CHECK: Op print with all flags: %{{.*}} = "arith.constant"() {elts = opaque<"_", "0xDEADBEEF"> : tensor<4xi32>, value = 0 : index} : () -> index loc(unknown) + // CHECK: Op print with all flags: %{{.*}} = "arith.constant"() {elts = opaque<"elided_large_const", "0xDEADBEEF"> : tensor<4xi32>, value = 0 : index} : () -> index loc(unknown) // clang-format on mlirOpPrintingFlagsDestroy(flags); diff --git a/mlir/test/IR/pretty-attributes.mlir b/mlir/test/IR/pretty-attributes.mlir --- a/mlir/test/IR/pretty-attributes.mlir +++ b/mlir/test/IR/pretty-attributes.mlir @@ -5,17 +5,17 @@ // tensor which passes don't look at directly, this isn't an issue. // RUN: mlir-opt %s -mlir-elide-elementsattrs-if-larger=2 | mlir-opt -// CHECK: opaque<"_", "0xDEADBEEF"> : tensor<3xi32> +// CHECK: opaque<"elided_large_const", "0xDEADBEEF"> : tensor<3xi32> "test.dense_attr"() {foo.dense_attr = dense<[1, 2, 3]> : tensor<3xi32>} : () -> () // CHECK: dense<[1, 2]> : tensor<2xi32> "test.non_elided_dense_attr"() {foo.dense_attr = dense<[1, 2]> : tensor<2xi32>} : () -> () -// CHECK: opaque<"_", "0xDEADBEEF"> : vector<1x1x10xf16> +// CHECK: opaque<"elided_large_const", "0xDEADBEEF"> : vector<1x1x10xf16> "test.sparse_attr"() {foo.sparse_attr = sparse<[[0, 0, 5]], -2.0> : vector<1x1x10xf16>} : () -> () -// CHECK: opaque<"_", "0xDEADBEEF"> : tensor<100xf32> -"test.opaque_attr"() {foo.opaque_attr = opaque<"_", "0xEBFE"> : tensor<100xf32> } : () -> () +// CHECK: opaque<"elided_large_const", "0xDEADBEEF"> : tensor<100xf32> +"test.opaque_attr"() {foo.opaque_attr = opaque<"elided_large_const", "0xEBFE"> : tensor<100xf32> } : () -> () // CHECK: dense<1> : tensor<3xi32> "test.dense_splat"() {foo.dense_attr = dense<1> : tensor<3xi32>} : () -> () diff --git a/mlir/test/python/ir/operation.py b/mlir/test/python/ir/operation.py --- a/mlir/test/python/ir/operation.py +++ b/mlir/test/python/ir/operation.py @@ -555,7 +555,7 @@ print(bytes_value) # Test get_asm with options. - # CHECK: value = opaque<"_", "0xDEADBEEF"> : tensor<4xi32> + # CHECK: value = opaque<"elided_large_const", "0xDEADBEEF"> : tensor<4xi32> # CHECK: "std.return"(%arg0) : (i32) -> () -:4:7 module.operation.print( large_elements_limit=2,