On Mon, 2014-09-29 at 20:24 +0100, Jiong Wang wrote: > On 29/09/14 19:32, Richard Henderson wrote: > > On 09/29/2014 11:12 AM, Jiong Wang wrote: > >> +inline rtx single_set_no_clobber_use (const rtx_insn *insn) > >> +{ > >> + if (!INSN_P (insn)) > >> + return NULL_RTX; > >> + > >> + if (GET_CODE (PATTERN (insn)) == SET) > >> + return PATTERN (insn); > >> + > >> + /* Defer to the more expensive case, and return NULL_RTX if there is > >> + USE or CLOBBER. */ > >> + return single_set_2 (insn, PATTERN (insn), true); > >> } > > Richard, > > thanks for review. > > > What more expensive case? > > single_set_no_clobber_use is just a clone of single_set, I copied the > comments with > only minor modifications.
I introduced that comment to single_set, in r215089, when making single_set into an inline function (so that it could check that it received an rtx_insn *, rather than an rtx). > I think the "more expensive case" here means the case where there are > PARALLEL that > we need to check the inner rtx. My comment may have been misleading, sorry. IIRC, what I was thinking that the old implementation had split single_set into a macro and a function. This was by Honza (CCed), 14 years ago to the day back in r36664 (on 2000-09-29): https://gcc.gnu.org/ml/gcc-patches/2000-09/msg00893.html /* Single set is implemented as macro for performance reasons. */ #define single_set(I) (INSN_P (I) \ ? (GET_CODE (PATTERN (I)) == SET \ ? PATTERN (I) : single_set_1 (I)) \ : NULL_RTX) I think by "the more expensive case" I meant having to make a function call to handle the less-common cases (which indeed covers the PARALLEL case), rather than having logic inline; preserving that inlined vs not-inlined split was one of my aims for r215089. Perhaps it should be rewritten to "Defer to a function call to handle the less common cases", or somesuch? [...snip rest of post...] Dave