[llvm] [IR] Add persistent metadata IDs for faster debug printing (PR #216838)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 11:57:22 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);
+
----------------
aengelke wrote:

Hmm, yeah, I agree that print-order-dependent behavior is not good. How expensive (=> c-t-t) is it to eagerly assign (non-temporary?) MDNodes numbers when they are created? The header should have some spare bits (22 bits on 32-bit systems, 54 on 64-bit systems; we could probably grow the header on 32-bit systems to 8 bytes if we think that >=1 MDNode per 1kiB of used memory can occur).

https://github.com/llvm/llvm-project/pull/216838


More information about the llvm-commits mailing list