This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] i386: Separate costs of pseudo registers from hard registers
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Jan Hubicka <hubicka at ucw dot cz>, Uros Bizjak <ubizjak at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, skpgkp1 at gmail dot com, Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 9 Aug 2019 16:13:14 -0700
- Subject: Re: [PATCH] i386: Separate costs of pseudo registers from hard registers
- References: <CAMe9rOo04knepkq4WAXCs8kaD0KXxJ3Ur=wfs39uub1rVV=Ptw@mail.gmail.com> <CAFULd4ZCW9RzJF+eU=DcLmdSGKe7icPBjdB6+WTZ6CcOfYAxCQ@mail.gmail.com> <CAFULd4Yrh7d7=ROuZaE=VsoOo+n+BXWOq+GSXss0aaoiLHE_MQ@mail.gmail.com> <CAMe9rOq2ikyj-U-b+9uxGvXi8A3Or2ipkngp8q4SD5P-V7C7Hw@mail.gmail.com> <CAFULd4YbzOUL76TWGtPrR6KOoJr-6dxoLVAGLrhEAEvF7dQx1Q@mail.gmail.com> <20190620211050.whgnitxuudbha6u2@kam.mff.cuni.cz> <alpine.LSU.2.20.1906241531480.10704@zhemvz.fhfr.qr> <CAMe9rOphbgGHsXSViQ6=R6czfAyLaTe3k7OYTwZAtu8tdh1Hew@mail.gmail.com> <CAMe9rOpWCLPbpfawhUFO+G1BJJKayUicg3r09-J4z6k5X6BbpQ@mail.gmail.com> <3ccb3101-aac9-fd2f-65fb-b53ee0e98d54@redhat.com>
On Fri, Aug 9, 2019 at 3:01 PM Jeff Law <law@redhat.com> wrote:
>
> On 7/23/19 3:57 PM, H.J. Lu wrote:
> [ Snip ]
> > Here is the updated patch to improve register allocator and RTL
> > expressions independently.
> >
> > Any comments?
> >
> > Thanks.
> >
> >
> > -- H.J.
> >
> >
> > 0001-i386-Separate-costs-of-pseudo-registers-from-hard-re.patch
> >
> > From 79834daf252cecfc3ee51acd864641d2cdaff733 Mon Sep 17 00:00:00 2001
> > From: "H.J. Lu" <hjl.tools@gmail.com>
> > Date: Fri, 14 Jun 2019 13:30:16 -0700
> > Subject: [PATCH] i386: Separate costs of pseudo registers from hard registers
> >
> > processor_costs has costs of RTL expressions with pseudo registers and
> > and costs of hard register moves:
> >
> > 1. Costs of RTL expressions are used to generate the most efficient RTL
> > operations with pseudo registers.
> >
> > 2. Costs of hard register moves are used by register allocator to
> > decide how to allocate and move hard registers.
> >
> > Since relative costs of pseudo register load and store versus pseudo
> > register moves in RTL expressions can be different from relative costs
> > of hard registers, we should separate costs of RTL expressions with
> > pseudo registers from costs of hard registers so that register allocator
> > and RTL expressions can be improved independently.
> >
> > This patch moves costs of hard register moves to the new hard_register
> > field and duplicates costs of moves which are also used for costs of RTL
> > expressions.
> >
> > PR target/90878
> > * config/i386/i386.c (inline_memory_move_cost): Use hard_register
> > for costs of hard register moves.
> > (ix86_register_move_cost): Likewise.
> > * config/i386/i386.h (processor_costs): Move costs of hard
> > register moves to hard_register. Add int_load, int_store,
> > xmm_move, ymm_move, zmm_move, sse_to_integer, integer_to_sse,
> > sse_load, sse_store, sse_unaligned_load and sse_unaligned_store
> > for costs of RTL expressions.
> > * config/i386/x86-tune-costs.h: Move costs of hard register
> > moves to hard_register. Duplicate int_load, int_store,
> > xmm_move, ymm_move, zmm_move, sse_to_integer, integer_to_sse,
> > sse_load, sse_store for costs of RTL expressions.
> This looks reasonable to me. If you haven't had objections from Jan or
> Uros, go ahead and commit it.
Will do.
> I'm assuming this patch isn't supposed to actually change anything yet
> and a subsequent patch will twiddle some of the costs, particularly for
> skylake.
>
We have a one-line followup patch to actually fix:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90878
Thanks.
--
H.J.