This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: MN10300: Add redundant comparison elimination pass
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: rth at redhat dot com, law at redhat dot com, aoliva at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Jan 2011 21:04:24 -0500 (EST)
- Subject: Re: RFA: MN10300: Add redundant comparison elimination pass
- References: <m3aalhzif0.fsf@redhat.com>
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