This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use simplify_replace_rtx rather than wrap_constant


> Do you think the changes are unsafe, or are you worried about the
> performance impact?  If the latter, then what about my suggestion
> of making rtx_equal_p an inline wrapper to an out-of-line function?
> I think that is a separate change, but I'm happy to do it if you
> think it's worthwhile (or even necessary for the main patch to
> be acceptable).

FWIW I share Bernd's concerns, in particular I'd be cautious about unsharing 
everything by default; the recog.c approach might be better, with the two 
variants validate_change and validate_unshare_change

But I agree that making rtx_equal_p an inline wrapper would be a good idea to 
speed things up; there are already a few manual attemps, e.g.

  /* X matches FROM if it is the same rtx or they are both referring to the
     same register in the same mode.  Avoid calling rtx_equal_p unless the
     operands look similar.  */

  if (x == from
      || (REG_P (x) && REG_P (from)
	  && GET_MODE (x) == GET_MODE (from)
	  && REGNO (x) == REGNO (from))
      || (GET_CODE (x) == GET_CODE (from) && GET_MODE (x) == GET_MODE (from)
	  && rtx_equal_p (x, from)))
    {
      validate_unshare_change (object, loc, to, 1);
      return;
    }

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]