This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: MN10300: Add redundant comparison elimination pass


On Wed, 10 Nov 2010, Nick Clifton wrote:
> Hi Guys,
>
>   As Richard pointed out my previous patch (for LIW/SETLB) included a
>   separate feature which should have been submitted on its own.  So here
>   it is - a machine reorg pass to eliminate redundant compares.

> +  /* Look for this sequence:
> +
> +       (set (reg X)  (arith_op (...)))
> +       (set (reg CC) (compare (reg X) (const_int 0)))
> +       (set (pc)     (if_then_else (EQ|NE (...)) (...) (...)))
> +
> +     And remove the compare as the flags in the
> +     EPSW register will already be correctly set.  */

I see parts of this may have gone moot, but shouldn't that set
of (reg CC) instead be moved into a parallell with the arith_op
setting?  Or else the use of (reg CC) may be (at least
theoretically) moved in later passes?  Right, there may be no
such "later passes" at the moment, but still...

brgds, H-P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]