[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:31:16 PDT 2026
================
@@ -3570,6 +3587,15 @@ void OperationPrinter::printResourceFileMetadata(
if (charLimit.value() == 0)
return;
+ // Skip serializing entirely if the exact size already exceeds the
+ // limit, e.g. hex-encoding a large blob.
+ if (sizeHint >= 0 && uint64_t(sizeHint) > charLimit.value()) {
+ LLVM_DEBUG(llvm::dbgs() << "eliding resource '" << key
----------------
joker-eph wrote:
Please use `LDBG()` for debugging instead
https://github.com/llvm/llvm-project/pull/213920
More information about the Mlir-commits
mailing list