llvm-project
c49bda1f - [PGO][NFC] Make CFGMST debug dump order deterministic (#200835)

Commit
18 days ago
[PGO][NFC] Make CFGMST debug dump order deterministic (#200835) The PGO instrumentation pass can print a per-function CFG-MST dump under -debug-only=pgo-instrumentation. The basic blocks were listed in the iteration order of a DenseMap keyed by the block pointer, so the same function could print its blocks in a different order from one run or machine to the next, even when nothing about the MST actually changed. That makes the dump hard to diff. For example, two runs of the same build could print the same blocks in different orders: ``` run 1: run 2: BB: entry ... BB: if.else ... BB: if.then ... BB: entry ... BB: if.else ... BB: if.then ... ``` and a plain `diff` would flag every line, hiding any real difference. Sort the blocks by their assigned MST Index (with the block name as a stable tiebreaker) before printing, so the dump is reproducible across runs and platforms. This only affects -debug/dump output; codegen is unchanged (NFC).
Author
Parents
Loading