backthreader: dump the profitability path in one place
Backthreader's profitability path dumping is consolidated for easier code modification.
The logic for dumping the profitability path in the backthreader pass has been moved to occur after the instruction counting loop, rather than interleaving with it. This reorganization simplifies modifications to the counting loop and prepares for the return of per-block statistics.
In Details
In tree-ssa-threadbackward.cc, the back_threader_profitability::possibly_profitable_path_p function previously interleaved debugging dumps of the profitability path with the loop that counted the path's instructions. This commit separates these concerns by moving the path dumping logic to execute solely after the counting loop completes. This makes it easier to refactor the counting loop without simultaneously impacting the dump output, and is a preparatory step for reintroducing per-block statistics to the profitability calculation.
- backthreader
- A GCC optimization pass that reorders instructions to improve parallelism. It analyzes execution paths to determine the most profitable reordering strategies.
- profitability path
- A sequence of basic blocks within a control flow graph that the backthreader pass analyzes to determine if instruction reordering would be beneficial.