[SimplifyCFG] Hoist common code for switch multi-case destinations (#165700)
Previously, hoistCommonCodeFromSuccessors did not support hoisting
common code for multi-case destinations of `switch`.
However, if all the predecessors of a given Succ are the same (i.e.,
multi-case destination), it is safe to hoist the common code from Succ
to Pred, which is what this PR does.
See discussion
https://github.com/llvm/llvm-project/pull/165570#discussion_r2473290327.
Alive2 proof: https://alive2.llvm.org/ce/z/cYuczq
Optimization Impact:
https://github.com/dtcxzyw/llvm-opt-benchmark/pull/3003