> > Honza, I think the pass manager should call default_rtl_profile () before > > each > > RTL pass to avoid this, no? > > Please note that we have plenty of existing peephole2s that use > optimize_insn_for_speed_p predicate. It is assumed to work ...
It is set by peep2 pass static void peephole2_optimize (void) { rtx insn; bitmap live; int i; basic_block bb; peep2_do_cleanup_cfg = false; peep2_do_rebuild_jump_labels = false; df_set_flags (DF_LR_RUN_DCE); df_note_add_problem (); df_analyze (); /* Initialize the regsets we're going to use. */ for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i) peep2_insn_data[i].live_before = BITMAP_ALLOC (®_obstack); live = BITMAP_ALLOC (®_obstack); FOR_EACH_BB_REVERSE (bb) { bool past_end = false; int pos; rtl_profile_for_bb (bb); ^^^ here. spliters/peepholes should be safe as splitting/peephole and combine passes care about the profile. What is unreliable somewhat is expansion is done late, like from loop optimizer. I am not sure how much of those we have left. Honza > > Uros.