This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about merging two instructions.
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Roger Sayle <roger at eyesopen dot com>, Leehod at il dot ibm dot com, Steven Bosscher <stevenb at suse dot de>,GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 22 Aug 2005 09:10:40 +0200
- Subject: Re: Question about merging two instructions.
- References: <Pine.LNX.4.44.0508211022100.21895-100000@www.eyesopen.com>
This approach seems reasonable. The current structure of the code
in simplify_replace_rtx is intended to handle RTL expressions rather
than patterns, so normally it would be passed just SET_SRC (pat),
instead of the whole set.
Which is why, OTOH, I would be *extremely* cautious doing such a
change. Leehod said:
> I tried to use simplify_replace_rtx to replace any use of (reg r) with[in]
> the right-hand-side of the extension and simplify the result.
If he want to replace uses within the RHS of the extension, he should
pass SET_SRC (pat). He may as well want to handle parallels, in which
case he should write a new function similar to this:
int i;
if (GET_CODE (pat) == SET)
SET_SRC (pat) = simplify_replace_rtx (SET_SRC (pat), old, new);
else if (GET_CODE (pat) == PARALLEL)
for (i = 0; i < XVECLEN (pat, 0); i++)
{
rtx s = XVECEXP (pat, 0, i);
if (GET_CODE (XVECEXP (pat, 0, i)) == SET)
SET_SRC (s) = simplify_replace_rtx (SET_SRC (s), old, new);
}
Paolo