Hi! On Tue, Nov 12, 2019 at 04:32:36PM +0100, Ilya Leoshkevich wrote: > > Am 12.11.2019 um 15:32 schrieb Segher Boessenkool > > <seg...@kernel.crashing.org>: > > On Tue, Nov 12, 2019 at 03:11:05PM +0100, Ilya Leoshkevich wrote: > >> unsigned int > >> pass_jump_after_combine::execute (function *) > >> { > >> + /* Jump threading does not keep dominators up-to-date. */ > >> + free_dominance_info (CDI_DOMINATORS); > >> + free_dominance_info (CDI_POST_DOMINATORS); > >> cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0); > >> return 0; > >> } > > > > Why do you always free it, if if only gets invalidated if flag_thread_jumps? > > > > It may be a good idea to throw away the dom info anyway, but the comment > > seems off then? > > Hmm, come to think of it, it would make sense to make flag_thread_jumps > a gate for this pass, and then run free_dominance_info (CDI_DOMINATORS) > and cleanup_cfg (CLEANUP_THREADING) unconditionally. What do you think?
But we want cleanup_cfg (0) if the flag is not set, no? Maybe something like unsigned int pass_jump_after_combine::execute (function *) { if (flag_thread_jumps) { /* Jump threading does not keep dominators up-to-date. */ free_dominance_info (CDI_DOMINATORS); cleanup_cfg (CLEANUP_THREADING); } else cleanup_cfg (0); return 0; } But OTOH it may well be the case that other things in cleanup_cfg make the known dominance info invalid as well, in which case just the comment is a bit misleading. Sounds likely to me :-) Segher