backthreader: group the per-path stats into a struct
Backthreader's per-path statistics are now grouped into a struct for cleaner management.
To improve code clarity and manageability, the backthreader pass now groups its per-path statistics into a dedicated path_stats struct. This change consolidates related fields, allowing them to be moved and cleared as a unit, simplifying the tree-ssa-threadbackward.cc implementation.
In Details
This commit refactors the back_threader_profitability class in tree-ssa-threadbackward.cc by introducing a path_stats struct. This struct encapsulates fields like m_threaded_through_latch, m_multiway_branch_in_path, m_contains_hot_bb, and m_unprofitable_bb, which were previously members of the class. Grouping these into a struct facilitates easier data management, such as moving and clearing the stats as a single unit, making the code cleaner and less error-prone.
- backthreader
- A GCC optimization pass that reorders instructions to improve parallelism. It analyzes execution paths to determine the most profitable reordering strategies.
- struct
- A composite data type in C/C++ that groups together variables of different data types under a single name. It helps in organizing related data.
- multiway branch
- A control flow instruction that can transfer execution to one of several different locations based on a condition or value.