Ilya Leoshkevich <i...@linux.ibm.com> writes: > On Mon, 2021-03-22 at 18:23 +0000, Richard Sandiford wrote: >> Ilya Leoshkevich <i...@linux.ibm.com> writes: > > [...] > >> > Do you still want me to add single_nondebug_use() for completeness >> > in >> > this patch, or would it be better to add it later when it's >> > actually >> > needed? >> >> I was thinking that the fwprop.c code would use >> def->single_nondebug_use () instead of >> def->single_nondebug_insn_use () && !def->has_phi_uses (). > > But these two are not equivalent, are they? single_nondebug_use() > that you proposed explicitly allows phis: > > // If there is exactly one nondebug use of the set's result, > // return that use, otherwise return null. The use might be in > // instruction or a phi node. > use_info *single_nondebug_use () const; > > but I don't think we want to propagate into phis here. > Or should the check be a bit bigger, like the following?
But we're in the process of substituting the definition into an insn use. So we know that an insn use exists. I think the question we're trying to answer is: is this insn use the only nondebug use? I'd rather test that with a single accessor rather than break it down into individual data structure tests. Thanks, Richard