try_replace_reg improvement
Jeffrey A Law
law@cygnus.com
Tue Oct 26 00:55:00 GMT 1999
In message < 19991019180343.18803@atrey.karlin.mff.cuni.cz >you write:
> Hi
> The try_replace_reg fails when new insn don't match. This limits
> the constant propagation in i386 a lot, because first operand
> is not allowed to be register.
>
> I've changed it to create/update the REG_EQUIV note to improve CSE2.
> This seems to improve CPROP a lot.
>
> Mon Oct 18 23:51:16 CEST 1999
> * gcse.c (try_replace_reg): Emit and update EQUIV notes
> when neccesary.
This code needs a fair amount of work. You've created something that is
far more difficult to read and understand than it should be. I have no
idea why you made the code as complex as you did.
I don't see the need to handle update of the notes separately when we have
a valid replacement for the insn vs when we do not have a valid replacement.
It seems to me you should always do that replacement. That will simplify
the code quite a bit.
You also have to be careful about having something like (REG_EQUAL, (reg X))).
A REG_EQUAL should be an expression or constant, not a naked register.
So, while I generally like the idea, I think the code you wrote is, well,
a minor mess and will create notes like (REG_EQUAL, (reg X)), which is a
no-no.
Finally, I would expect the vast majority of the time if the insn already has
a note, that it will reference FROM, so I believe calling reg_mentioned_p is
just a waste of time.
jeff
More information about the Gcc-patches
mailing list