Note that I don't want to replace any *def* and uses may appear in the
LHS.
Ok, I see. But you have to cope with *def*s appearing in the LHS: you
don't want to replace them, yet your modified simplify_replace_rtx will!
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)
Not really, as it will happily replace within a STRICT_LOW_PART, but
that may as well be a bug.
I think you're best off making your own function for now. And make it
use validate_change so that you won't have to call recog manually.
Paolo