Paolo Bonzini <[EMAIL PROTECTED]> wrote on 22/08/2005 10:10:40:
> > > 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:

I think you misunderstood my original purpose. I did mean [with]
and not [in].
Let me explain again.

I have these two instructions:

(insn 1 0 2 0 (set (reg/v:Xmode r)
        (sign_extend:Xmode (op:Ymode (...))))
(insn 2 1 3 0 (set (LHS) (RHS)))

where:
1. Xmode > Ymode
2. RHS and/or LHS may contain: 
   (subreg:Ymode (reg/v:Xmode r) lowpart) and/or (reg/v:Xmode r).

Now I want to replace every *use* of (reg r) in insn 2 with the rhs of
insn 1 and simplify the result.  This is way the replacement may happen
in the LHS of insn 2.
Note that I don't want to replace any *def* and uses may appear in the 
LHS.

My plan was to use: replace_regs () to replace every use of (reg r)
with the a new pseudo register (because this is the only function that
I found that separates the uses from the defs) and then use
simplifiy_replace_rtx () to replace that new pseudo register with the rhs 
of insn 1 and simplify.

To make things even more complicated - insn 2 may be PARALLEL.

Maybe I should use simplify_rtx (replace_rtx (..))?
But it seem to me that simplify_rtx () doesn't deal with SET either.

Do you see a better way?

Thanks,
Leehod.











Reply via email to