On Fri, Aug 9, 2019 at 3:01 PM Jeff Law <l...@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.to...@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.