public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH V2 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA
@ 2024-04-24 10:05 Lehua Ding
  2024-04-24 10:05 ` [PATCH 1/4] df: Add -ftrack-subreg-liveness option Lehua Ding
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Lehua Ding @ 2024-04-24 10:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: juzhe.zhong, shuo.chen, jin.xia, vmakarov, richard.sandiford

Hi Vladimir and Richard,

These patches are used to add a new data flow DF_LIVE_SUBREG,
which will track subreg liveness and then apply it to IRA and LRA
passes (enabled via -O3 or -ftrack-subreg-liveness). These patches
are for GCC 15. And these codes are pushed to the devel/subreg-coalesce
branch. In addition, my colleague Shuo Chen will also be involved in some
of the remain work, thank you for your support.

These patches are separated from the subreg-coalesce patches submitted
a few months ago. I refactored the code according to comments. The next
patches will support subreg coalesce base on they. Here are some data
abot build time of SPEC INT 2017 (x86-64 target):

                          baseline   baseline(+track-subreg-liveness)
specint2017 build time :  1892s      1883s

Regarding build times, I've run it a few times, but they all seem to take
much less time. Since the difference is small, it's possible that it's just
a change in environment. But it's theoretically possible, since supporting
subreg-liveness could have reduced the number of living regs.

For memory usage, I trided PR 69609 by valgrind, peak memory size grow from
2003910656 to 2003947520, very small increase.

No regression on x86-64

Co-authored-by: Shuo Chen <shuo.chen@rivai.ai>

Best,
Lehua

Lehua Ding (4):
  df: Add -ftrack-subreg-liveness option
  df: Add DF_LIVE_SUBREG problem
  ira: Apply DF_LIVE_SUBREG data
  lra: Apply DF_LIVE_SUBREG data

 gcc/Makefile.in          |   1 +
 gcc/common.opt           |   4 +
 gcc/common.opt.urls      |   3 +
 gcc/df-problems.cc       | 855 ++++++++++++++++++++++++++++++++++++++-
 gcc/df.h                 | 155 +++++++
 gcc/doc/invoke.texi      |   8 +
 gcc/ira-build.cc         |   7 +-
 gcc/ira-color.cc         |   8 +-
 gcc/ira-emit.cc          |  12 +-
 gcc/ira-lives.cc         |   7 +-
 gcc/ira.cc               |  19 +-
 gcc/lra-coalesce.cc      |  27 +-
 gcc/lra-constraints.cc   | 109 ++++-
 gcc/lra-int.h            |   4 +
 gcc/lra-lives.cc         | 357 ++++++++++++----
 gcc/lra-remat.cc         |   8 +-
 gcc/lra-spills.cc        |  27 +-
 gcc/lra.cc               |  10 +-
 gcc/opts.cc              |   1 +
 gcc/regs.h               |   5 +
 gcc/sbitmap.cc           |  98 +++++
 gcc/sbitmap.h            |   2 +
 gcc/subreg-live-range.cc |  53 +++
 gcc/subreg-live-range.h  | 206 ++++++++++
 gcc/timevar.def          |   1 +
 25 files changed, 1851 insertions(+), 136 deletions(-)
 create mode 100644 gcc/subreg-live-range.cc
 create mode 100644 gcc/subreg-live-range.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA
@ 2024-02-03 10:50 Lehua Ding
  2024-02-03 10:50 ` [PATCH 1/4] df: Add -ftrack-subreg-liveness option Lehua Ding
  0 siblings, 1 reply; 11+ messages in thread
From: Lehua Ding @ 2024-02-03 10:50 UTC (permalink / raw)
  To: gcc-patches; +Cc: vmakarov, richard.sandiford, juzhe.zhong, lehua.ding

Hi,

These patches are used to add a new data flow DF_LIVE_SUBREG,
which will track subreg liveness and then apply it to IRA and LRA
passes (enabled via -O3 or -ftrack-subreg-liveness). These patches
are for GCC 15.

These patches are separated from the subreg-coalesce patches submitted
a few months ago. I refactored the code according to comments. The next
patches will support subreg coalesce base on they. Here are some data
abot build time of SPEC INT 2017 (x86-64 target):

                          baseline   baseline(+track-subreg-liveness)
specint2017 build time :  1892s      1883s

Regarding build times, I've run it a few times, but they all seem to take
much less time. Since the difference is small, it's possible that it's just
a change in environment. But it's theoretically possible, since supporting
subreg-liveness could have reduced the number of living regs.

For memory usage, I trided PR 69609 by valgrind, peak memory size grow from
2003910656 to 2003947520, very small increase.

For SPEC INT 2017, when using upstream GCC (whitout these patches), I get a
coredump when training the peak case, so no data yet. The cause of the core
dump still needs to be investigated.

No regression on x86-64, AArch64 and RISC-V target.

Best,
Lehua

Lehua Ding (4):
  df: Add -ftrack-subreg-liveness option
  df: Add DF_LIVE_SUBREG problem
  ira: Apply DF_LIVE_SUBREG data
  lra: Apply DF_LIVE_SUBREG data

 gcc/Makefile.in          |   1 +
 gcc/common.opt           |   4 +
 gcc/df-problems.cc       | 855 ++++++++++++++++++++++++++++++++++++++-
 gcc/df.h                 | 155 +++++++
 gcc/ira-build.cc         |   7 +-
 gcc/ira-color.cc         |   8 +-
 gcc/ira-emit.cc          |  12 +-
 gcc/ira-lives.cc         |   7 +-
 gcc/ira.cc               |  19 +-
 gcc/lra-coalesce.cc      |  27 +-
 gcc/lra-constraints.cc   | 109 ++++-
 gcc/lra-int.h            |   4 +
 gcc/lra-lives.cc         | 355 ++++++++++++----
 gcc/lra-remat.cc         |   8 +-
 gcc/lra-spills.cc        |  27 +-
 gcc/lra.cc               |  10 +-
 gcc/opts.cc              |   1 +
 gcc/regs.h               |   5 +
 gcc/sbitmap.cc           |  98 +++++
 gcc/sbitmap.h            |   2 +
 gcc/subreg-live-range.cc |  53 +++
 gcc/subreg-live-range.h  | 206 ++++++++++
 gcc/timevar.def          |   1 +
 23 files changed, 1839 insertions(+), 135 deletions(-)
 create mode 100644 gcc/subreg-live-range.cc
 create mode 100644 gcc/subreg-live-range.h

-- 
2.36.3


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

end of thread, other threads:[~2024-05-08 22:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24 10:05 [PATCH V2 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Lehua Ding
2024-04-24 10:05 ` [PATCH 1/4] df: Add -ftrack-subreg-liveness option Lehua Ding
2024-04-24 10:05 ` [PATCH 2/4] df: Add DF_LIVE_SUBREG problem Lehua Ding
2024-04-25 20:56   ` Dimitar Dimitrov
2024-05-08  2:46     ` Lehua Ding
2024-05-08  3:34     ` 陈硕
2024-05-08 15:57       ` Dimitar Dimitrov
2024-05-08 22:54         ` 钟居哲
2024-04-24 10:05 ` [PATCH 3/4] ira: Apply DF_LIVE_SUBREG data Lehua Ding
2024-04-24 10:05 ` [PATCH 4/4] lra: " Lehua Ding
  -- strict thread matches above, loose matches on Subject: below --
2024-02-03 10:50 [PATCH 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Lehua Ding
2024-02-03 10:50 ` [PATCH 1/4] df: Add -ftrack-subreg-liveness option Lehua Ding

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).