https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68173
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stevenb.gcc at gmail dot com --- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- callgrind points at bitmap_set_bit called via process_bb_lives -> mark_regno_dead. Maybe some code in that (the DCE code?) can be keyed on if (optimize). in mark_regno_dead callgrind points to bitmap_set_bit (bb_killed_pseudos, regno); being the expensive one. I suppose the issue here is that the bit access pattern to that bitmap is random which exposes our O(n) complexity of bitmap_find_bit... Indeed for bitmap_find_bit the linear search for if (head->indx < indx) is the "hot" part. I wonder if we should (finally) use a RB tree for bitmap. I even remember some patches posted to improve this (from Steven?) this or last year?