Switch-conv: Stabilize qsort in case_bit_test by using target BB index.
The switch conversion code now uses the target basic block index to stabilize qsort, removing the need for a label in `case_bit_test`.
The switch conversion code now uses the target basic block’s index to ensure a stable sort order in case_bit_test, instead of a label. This simplifies the code by removing the label field from case_bit_test. This change should have no user-visible impact, but improves internal code structure.
In Details
This commit modifies tree-switch-conversion.cc to remove the label field from the case_bit_test struct and instead use the target basic block's index for sorting stability. The case_bit_test struct is used within the switch conversion pass to represent individual cases in a bit-test-based switch statement. The change primarily affects the internal data structures and algorithms used during switch conversion.
For Context
The switch conversion optimization in GCC transforms switch statements into more efficient code sequences, often using bit tests or jump tables. This optimization involves analyzing the cases in the switch statement and rearranging them for better performance. The qsort function is a standard library function used for sorting elements in an array. By using the target basic block's index for sorting within the switch conversion process, the compiler ensures a consistent and predictable order, which can improve code generation and reduce unexpected behavior.