[Mlir-commits] [mlir] [mlir][Printer] Honor --mlir-elide-resource-strings-if-larger when serializing of large blobs (PR #213920)
Natanael Cintean
llvmlistbot at llvm.org
Tue Aug 4 07:16:12 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
----------------
natanael-cintean wrote:
Agree. What I meant is that I've added this type of debug print so that I can test the branch in a lit test. Otherwise, the check [here](https://github.com/llvm/llvm-project/pull/213920/changes#diff-7e43770186249840f0ec7904e2d5562c796ff993f67250c275a6d7918a95130cR3603) is eliding big resources anyway, but only after serialization.
So eliding happens either way, meaning a lit test would have the same output with or without this change ,it's just a question of speed.
https://github.com/llvm/llvm-project/pull/213920
More information about the Mlir-commits
mailing list