[llvm] [IR] Speed up debug printing with persistent metadata IDs (PR #216838)
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 18 20:03:15 PDT 2026
================
@@ -111,6 +111,11 @@ static cl::opt<bool> PrintAddrspaceName("print-addrspace-name", cl::Hidden,
cl::init(false),
cl::desc("Print address space names"));
+static cl::opt<bool>
+ PrintIRFast("print-ir-fast",
+ cl::desc("Use faster lossy IR printing for debugging"),
+ cl::init(false), cl::Hidden);
+
----------------
yxsamliu wrote:
I updated the patch to assign IDs when MDNodes are created and store them in the spare header bits. Temporary nodes get an ID when they become permanent. The header size is unchanged.
[Compile-time-tracker](https://llvm-compile-time-tracker.com/compare.php?from=5e9e8930aea9bb156c3d85b1fc6448eb41098bb5&to=e7d10a9cfe5acc261a14b8535d79948d98da4d80&stat=instructions%3Au) is effectively flat, with configuration geomeans changing by at most +0.05%. I kept the option so normal function and module printing remain compact by default.
https://github.com/llvm/llvm-project/pull/216838
More information about the llvm-commits
mailing list