This is the mail archive of the
mailing list for the GCC project.
Re: RFA: MN10300: Add redundant comparison elimination pass
On 11/10/10 07:48, Nick Clifton wrote:
Hi Jeff,I'd like to see us DTRT, otherwise I suspect this will get dropped on
it is - a machine reorg pass to eliminate redundant compares.
My first thought is isn't this handled in a target independent way
elsewhere? How do the x86 and other targets that were converted away
from cc0 handle this stuff?
Paolo has pointed out that I ought to be using SELECT_CC_MODE to
return a new CC mode and then add patterns to combine the arithmetic
and comparison instructions using this mode.
He is right of course, but I would rather get this patch in and at
least remove some redundant compares, and then work on a better patch
at some point in the future. But if you feel we should be "doing the
right thing" right from the start then I will withdraw the patch and
try to work on a new one. In my copious free time of course... :-)
This really should have been taken care of during the transition away
from cc0, particularly since we had gone through the trouble to make
sure this optimization was working in the cc0 world :-)
ISTM you probably need just a few patterns to catch the vast majority of
useful cases -- using match_operator liberally of course.
I'd look to catch add/sub and the logicals; anything beyond those
probably isn't worth the headache.