https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110587
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vmakarov at gcc dot gnu.org --- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- Btw, with GCC 13.1 this is already a LRA hog: LRA non-specific : 3.31 ( 73%) 0.01 ( 9%) 3.33 ( 72%) 3876k ( 3%) TOTAL : 4.53 0.11 4.65 126M GCC 8 and before were worse. On trunk: LRA non-specific : 6.22 ( 69%) 0.02 ( 20%) 6.22 ( 69%) 8922k ( 6%) LRA hard reg assignment : 1.00 ( 11%) 0.02 ( 20%) 1.02 ( 11%) 0 ( 0%) TOTAL : 8.97 0.10 9.08 149M the above is with just -O0. Profile: Samples: 37K of event 'cycles:u', Event count (approx.): 49984847870 Overhead Samples Command Shared Object Symbol 51.58% 19087 cc1 cc1 [.] lra_final_code_change 11.10% 4106 cc1 cc1 [.] next_nondebug_insn 7.61% 2879 cc1 cc1 [.] bitmap_set_bit 6.42% 2425 cc1 cc1 [.] find_hard_regno_for_1 2.28% 842 cc1 cc1 [.] bitmap_bit_p 0.99% 365 cc1 cc1 [.] lra_create_live_ranges_1 it possibly means we now spill more, at -O0 at least. We have a 10% regression in assembly line count between 13 and trunk. The main hog in lra_final_code_change is calls to regno_in_use_p and the loop within that. The BB in this function is _huge_ so the whole process quickly becomes quadratic. Maybe the whole thing should work backwards on a BB and this info collected on-the-fly as some "liveness" problem?