[Mlir-commits] [mlir] [mlir]Add size check and skip serialization of large blobs. (PR #213920)
Mehdi Amini
llvmlistbot at llvm.org
Tue Aug 4 05:32:08 PDT 2026
================
@@ -31,11 +60,44 @@
// ZERO-EMPTY:
// ZERO-NEXT: #-}
+// At the exact boundary (limit == blob3's exact size) blob3 must still be printed,
+// since the sizeHint fast-path only elides when size is strictly greater than the limit.
+// BOUND14: {-#
+// BOUND14-NEXT: dialect_resources: {
+// BOUND14-NEXT: builtin: {
+// BOUND14-NEXT: blob3: "0x0800000001"
+// BOUND14-NEXT: }
+// BOUND14-NEXT: },
+// BOUND14-NEXT: external_resources: {
+// BOUND14-NEXT: external: {
+// BOUND14-NEXT: "backslash\\tab\09": true,
+// BOUND14-NEXT: string: "\22string\22"
+// BOUND14-NEXT: },
+// BOUND14-NEXT: other_stuff: {
+// BOUND14-NEXT: bool: true
+// BOUND14-NEXT: }
+// BOUND14-NEXT: }
+// BOUND14-NEXT: #-}
+
+// One below the boundary, blob3 is elided and no dialect_resources dict is emitted.
----------------
joker-eph wrote:
I would think we would still emit the blob, but restrict it to the first chars up to the limit?
https://github.com/llvm/llvm-project/pull/213920
More information about the Mlir-commits
mailing list