public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [0/9] Record number of hard registers in a REG
@ 2015-05-18 18:11 Richard Sandiford
  2015-05-18 18:13 ` [1/9] Make more use of END_REGNO Richard Sandiford
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Richard Sandiford @ 2015-05-18 18:11 UTC (permalink / raw)
  To: gcc-patches

While looking at a profile of gcc, I noticed one thing fairly high
up the list was a loop iterating over all the registers in a REG,
apparently due to the delay in computing the index for hard_regno_nregs
and then loading the value (which would often be an L1 cache miss).

When we were adding CONST_WIDE_INT, the general opinion seemed to be
that we should lay out rtxes for LP64 hosts rather than try to have two
alternative layouts, one optimised for ILP32 and one for LP64.  We therefore
unconditionally filled the 32-bit hole (on LP64) between the rtx header and
the main union with extra data.  That area is already used by REGs to store
ORIGINAL_REGNO, but on LP64 hosts there's another hole in the REGNO
field itself.  This series takes that idea a step further and uses the
hole to store the number of registers in a REG.

This still leaves 24 redundant bits that could be used for other things
in future.  That's actually enough to store a SUBREG of a REG (8 bits
for the inner mode, 16 for the offset), but having a single rtx for that
would probably cause too many problems.

The series sped up an --enable-checking=release gcc by just over 0.5%
for various tests on my box.  Not a big saving, but hopefully the
patches also count as a clean-up.

As a follow-on, I'd like to add a FOR_EACH_* macro that iterates over
all the registers in a REG.  These loops always execute at least once,
and rarely more than once, and it would be good to model that in the
iterator so that all use sites benefit.

Each patch in the series was individually bootstrapped & regression-tested
on x86_64-linux-gnu.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-05-22 19:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 18:11 [0/9] Record number of hard registers in a REG Richard Sandiford
2015-05-18 18:13 ` [1/9] Make more use of END_REGNO Richard Sandiford
2015-05-18 19:06   ` Jeff Law
2015-05-18 18:15 ` [2/9] Add a REG_NREGS macro Richard Sandiford
2015-05-18 20:27   ` Jeff Law
2015-05-19  7:00     ` Richard Sandiford
2015-05-18 18:19 ` [3/9] Clean up df_ref_change_reg_with_loc Richard Sandiford
2015-05-18 20:33   ` Jeff Law
2015-05-18 18:22 ` [4/9] Add a dedicated rtx union member for REGs Richard Sandiford
2015-05-18 20:41   ` Jeff Law
2015-05-19  7:04     ` Richard Sandiford
2015-05-19  7:17       ` Jeff Law
2015-05-18 18:23 ` [5/9] Create sensible dummy registers Richard Sandiford
2015-05-18 21:29   ` Jeff Law
2015-05-19  9:02   ` Eric Botcazou
2015-05-22 15:44     ` Richard Sandiford
2015-05-22 20:05       ` Jeff Law
2015-05-18 18:24 ` [6/9] Pass REG changes through a new function Richard Sandiford
2015-05-18 21:32   ` Jeff Law
2015-05-18 18:24 ` [7/9] Record the number of registers in a REG Richard Sandiford
2015-05-18 21:33   ` Jeff Law
2015-05-18 18:26 ` [8/9] Remove END_HARD_REGNO Richard Sandiford
2015-05-18 21:34   ` Jeff Law
2015-05-18 18:31 ` [9/9] Simplify register bitmap operations Richard Sandiford
2015-05-18 21:39   ` Jeff Law
2015-05-19 15:21 ` breakage with series "[0/9] Record number of hard registers in a REG" Hans-Peter Nilsson
2015-05-19 15:54   ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).