This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH, i386]: Enable post-reload compare elimination pass
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>, Jeff Law <law at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>, Nick Clifton <nickc at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Wed, 10 May 2017 22:27:08 +0200
- Subject: Re: [RFC PATCH, i386]: Enable post-reload compare elimination pass
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E6ADB859FA
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E6ADB859FA
- References: <CAFULd4beOEsXre1y+nz5c0iOUMVDmLYLO9yUiizHCtYw9bOWmg@mail.gmail.com> <20170510142710.GY1809@tucnak> <CAFULd4be1V1BkuzZx4+7i6ouwPqeFXWWo6QMkCXqqwh6GbedzQ@mail.gmail.com> <CAFULd4ZLes9A0mFFYvnv-CDC+n9w7hFw67PsP7Q9UTwz2eGUVA@mail.gmail.com> <CAFULd4Zku7jTKtwY_oSyAesrhcpOiSvfCEVx7=DxNX-L7f+ZoA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, May 10, 2017 at 09:57:56PM +0200, Uros Bizjak wrote:
> BTW: This patch now catches 417 cases (instead of 200+) in linux
> build, including e.g.:
>
> (parallel [
> (set (reg:CCZ 17 flags)
> (compare:CCZ (lshiftrt:SI (reg:SI 4 si [orig:93 _10 ] [93])
> (const_int 1 [0x1]))
> (const_int 0 [0])))
> (set (reg:DI 4 si)
> (zero_extend:DI (lshiftrt:SI (reg:SI 4 si [orig:93 _10 ] [93])
> (const_int 1 [0x1]))))
> ])
That looks nice. So, I think we need analysis on what order which targets
use. I have looked at mn10300.md, I see {add,sub}si3_flags patterns that
would need PARALLEL reordering for this compare-elim.c change and then
cmp_liw vs. liw_cmp patterns I have no clue what they do and whether
compare-elim.c would care about those or not (they have UNSPECs). Jeff/Alex?
In rx.md I see {add,sub}si3_flags too, then ssaddsi3 and 2 peepholes that
would need changing.
In visium.md I see flags_subst_{logic,arith} define_substs,
*{add,sub}<mode>3_insn_set_{carry,overflow}
{add,sub}si3_insn_set_{carry,overflow}, negsi2_insn_set_carry
and *neg<mode>2_insn_set_overflow that would need changing.
aarch64 is the only remaining compare-elim.c enabled target
(one that defines TARGET_FLAGS_REGNUM), and that one seems to use
the same parallel order as i386.md, so compare-elim.c most likely just
doesn't work there at all.
So all in all, sounds like we need to change at least 17 patterns on 3
not very widely used targets.
Jakub