> > Is it really sufficient here to verify that all the defs are on latch > predecessors, > what about the case where there is a predecessor without a def. How do > you guarantee domination in that case? > > ISTM that given the structure for the code you're writing that you'd want to > verify that in the event of multiple definitions that all of them appear on > immediate predecessors of the latch *and* that each immediate > predecessor has a definition.
Yes, do you think it's better to check exactly immediate predecessors? > > - > > - if (!just_once_each_iteration_p (current_loop, DF_REF_BB (adef))) > > - return false; > > + { > > + def_num++; > > + if (!(def_pred_latch = def_pred_latch_p (adef)) > > + || !rtx_equal_p( PATTERN (DF_REF_INSN (single_rd)), > > Whitespace nit here. Whitespace goes before the open paren for the > function call, not after. Thanks for catching this! > > > > @@ -351,10 +384,10 @@ latch_dominating_def (rtx reg, df_ref *def) > > static enum iv_grd_result > > iv_get_reaching_def (rtx_insn *insn, rtx reg, df_ref *def) > > And in this routine, you appear to do both checks. ie, each def is on an > immediate predecessor and each immediate predecessor has a def. Is there > some reason why iv_get_reaching_def has the stronger check while > latch_dominating_def does not? Looks like I was sure that latch_dominating_def always goes after iv_get_reaching_def but now I see it is not true. Will add another check in latch_dominating_def. Thanks, Igor > > jeff