[IR] Use persistent metadata IDs for printing (#216838)
Repeated pass and debug printing currently rebuilds metadata slot
numbers
by scanning the module. On large modules, this repeated setup can take
more time than printing the requested function.
Store a persistent print ID in each metadata node and use that ID
whenever
metadata is printed. Before final assembly output, renumber the IDs into
canonical compact order so normal textual IR output remains unchanged.
This keeps metadata numbers stable across pass snapshots while avoiding
repeated module-wide metadata scans.
GitOrigin-RevId: 85e903099313aa5ea98d175698aaa40e27a0d743
10 files changed