https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127889
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
And with callgrind update_lives () is shown to cause the majority of
bitmap_clear/set_bit calls.
for (r = lra_reg_info[regno].live_ranges; r != NULL; r = r->next)
{
for (p = r->start; p <= r->finish; p++)
if (free_p)
bitmap_clear_bit (&live_hard_reg_pseudos[p], regno);
else
{
bitmap_set_bit (&live_hard_reg_pseudos[p], regno);
insert_in_live_range_start_chain (regno);
}
with the main callers being from spill_for and the biggest offender
/* Restore the live hard reg pseudo info for spilled pseudos. */
EXECUTE_IF_SET_IN_BITMAP (&spill_pseudos_bitmap, 0, spill_regno, bi)
update_lives (spill_regno, false);
I wonder if tracking "spilled pseudos" separately and when querying
live_hard_reg_pseudo[] masking those out would be cheaper than updating
live_hard_reg_pseudo[].
the perf blamed spot in lra_assign is the 2nd hottest part.