https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117297
Bug ID: 117297 Summary: late combine undoes too much Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ak at gcc dot gnu.org Target Milestone: --- forked from PR117091 When the (admittedly extreme) test case from PR117091 is compiled with -O2 -fno-bit-tests -fno-jump-tables (to work around the switch scalability issues) the compiler spends ~70% of the time in late combine doing - 39.85% cc1 cc1 [.] temporarily_undo_changes(int) ◆ 39.84% temporarily_undo_changes(int) ▒ rtl_ssa::insn_info::calculate_cost() const ▒ - rtl_ssa::changes_are_worthwhile(array_slice<rtl_ssa::insn_change* const>, bool) ▒ - 31.12% (anonymous namespace)::late_combine::combine_into_uses(rtl_ssa::insn_info*, rtl_ssa::insn_info*) ▒ (anonymous namespace)::pass_late_combine::execute(function*) ▒ execute_one_pass(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ - 8.72% (anonymous namespace)::pass_late_combine::execute(function*) ▒ execute_one_pass(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ - 32.56% cc1 cc1 [.] redo_changes(int) ▒ 32.56% rtl_ssa::insn_info::calculate_cost() const ▒ - rtl_ssa::changes_are_worthwhile(array_slice<rtl_ssa::insn_change* const>, bool) ▒ - 25.50% (anonymous namespace)::late_combine::combine_into_uses(rtl_ssa::insn_info*, rtl_ssa::insn_info*) ▒ (anonymous namespace)::pass_late_combine::execute(function*) ▒ execute_one_pass(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ - 7.06% (anonymous namespace)::pass_late_combine::execute(function*) ▒ execute_one_pass(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒ execute_pass_list_1(opt_pass*) ▒