Reviewing my review :) Richard Sandiford <richard.sandif...@arm.com> writes: >> + >> + for (auto def : info->defs ()) >> + { >> + auto set = dyn_cast<set_info *> (def); >> + if (set && set->has_any_uses ()) >> + { >> + for (auto use : set->all_uses()) > > Nit: has_any_uses isn't necessary: the inner loop will simply do nothing > in that case. Also, we can/should restrict the scan to non-debug uses. > > This can then be: > > for (auto def : info->defs ()) > if (auto set = dyn_cast<set_info *> (def)) > for (auto use : set->nondebug_insn_uses())
I forgot the space before "()" in the line above. > >> + { >> + if (use->insn ()->is_artificial ()) >> + return false; >> + >> + insn_info *info = use->insn (); >> + >> + if (info >> + && info->rtl () > > This test shouldn't be necessary. > >> + && info->is_real ()) >> + { >> + rtx_insn *rtl_insn = info->rtl (); >> + rtx set = single_set (rtl_insn); >> + >> + if (set == NULL_RTX) >> + return false; >> + >> + rtx op0 = SET_SRC (set); >> + if (GET_CODE (op0) != UNSPEC) >> + return false; > [...] > Also, using single_set means that the function still lets through > parallels of two sets in which the sources are unspecs. Is that > intentional? I got this wrong, sorry. You return false for non-single_set, so that particular problem doesn't arise. But why do we want to reject uses of registers that are set by parallel sets? Thanks, Richard