This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Use simplify_replace_rtx rather than wrap_constant
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Bernd Schmidt <bernds_cb1 at t-online dot de>
- Date: Thu, 1 Oct 2009 15:57:10 +0200
- Subject: Re: Use simplify_replace_rtx rather than wrap_constant
- References: <87ljk1sr4c.fsf@firetop.home> <4AC35E54.7090404@t-online.de> <87y6nwdwvz.fsf@firetop.home>
> 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