[Docs] Document persistent metadata printing - #220967
Conversation
Document how persistent metadata IDs affect intermediate and standalone textual output. Final assembly output remains canonically renumbered. Follow-up to llvm#220390.
zmodem
left a comment
There was a problem hiding this comment.
Thanks! I don't have a lot of context on this, so may question might be naive, as may future readers :)
|
In the Rust tests I was looking at, the order did change though. In the first test I was looking at (https://github.com/rust-lang/rust/blob/main/tests/codegen-llvm/async-fn-debug-awaitee-field.rs) it seemed that If that's not expected, that seems like something that should be fixed. |
|
Thanks, you’re right. Rust calls |
|
Interesting! But I'm still confused, probably because I don't have enough context, but the readers of this release note won't have it either. It sounds like there are now "persistent" and "canonical" metadata node numbers -- the "persistent" ones are new, and the "canonical" ones should match what we had before. But what is the motivation for having two numberings? Should Rust also do the renumbering before printing, or just update its expectations to match the new numbering? |
|
@zmodem Re: metadata numbering Persistent IDs make pass dumps easier to compare: unchanged metadata keeps the same number as passes modify the module. Canonical numbering uses consecutive numbers with no gaps, in a consistent order, making final IR easier to read. For Rust’s final IR output, I’d call I’ll clarify the motivation and this recommendation in the release note. |
The release note names two numbering modes without explaining why clients should choose one over the other. Explain how persistent IDs help compare intermediate dumps, and how consecutive canonical IDs make final IR easier to read. Recommend renumbering before final output for clients that call Module::print() directly.
The release note explains how stable metadata IDs help compare output, but leaves out the printing speedup that motivated the change. Explain that reusing IDs avoids repeated scans of the whole module and can significantly speed up debug and pass printing on large modules.
Document how persistent metadata IDs affect intermediate and standalone textual output. Final assembly output remains canonically renumbered. Follow-up to llvm#220390.
Document how persistent metadata IDs affect intermediate and standalone
textual output. Final assembly output remains canonically renumbered.
Follow-up to #220390.