https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44563
--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> --- callgrind shows the cgraph_edge_hasher quite high in the profile (via redirect_all_calls). I suppose as the large main is a single BB walking all stmts over-and-over is quite bad. Also hash_pointer isn't inlined!? Ah - it's external in libiberty hashtab.c ... - it should transition to using/inheriting from pointer_hash. cgraph_edge * cgraph_node::get_edge (gimple call_stmt) { cgraph_edge *e, *e2; int n = 0; if (call_site_hash) return call_site_hash->find_with_hash (call_stmt, htab_hash_pointer (call_stmt)); The estimate_calls_size_and_time portion is quite smaller. cleanup-cfgs main portion is split_bb_on_noreturn_calls.