[0/4] aarch64, rtl-ssa: Fix wrong code in ldp fusion pass [PR113070]

Message ID ZaKvZJeL0M7G4Mgs@arm.com
Headers
Series aarch64, rtl-ssa: Fix wrong code in ldp fusion pass [PR113070] |

Message

Alex Coplan Jan. 13, 2024, 3:42 p.m. UTC
  This patch series restores PGO+LTO bootstrap on aarch64 (with the ldp
passes enabled) and fixes wrong code (leading to a segfault) seen in
cactuBSSN_r from SPEC CPU 2017 with PGO+LTO enabled.

For an example showing what goes wrong, see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113070#c7

In the case that we insert a new stp insn (as opposed to re-purposing an
existing store) RTL-SSA fails to properly insert the newly-created def
of memory into the def chain and the ldp/stp pass fails to update uses
of memory immediately following an stp insn.  This can lead to alias
analysis going wrong as it ends up incorrectly skipping over the stp
insn when analysing subsequent load pair candidates.

Bootstrapped/regtested as a series with/without the passes enabled on
aarch64-linux-gnu (1/4 also tested independently and no regressions).

OK for trunk?

Thanks,
Alex

Alex Coplan (4):
  rtl-ssa: Run finalize_new_accesses forwards [PR113070]
  rtl-ssa: Support for creating new uses [PR113070]
  rtl-ssa: Ensure new defs get inserted [PR113070]
  aarch64: Fix up uses of mem following stp insert [PR113070]

 gcc/config/aarch64/aarch64-ldp-fusion.cc | 248 ++++++++++++++++++-----
 gcc/rtl-ssa.h                            |   1 +
 gcc/rtl-ssa/accesses.cc                  |  10 +
 gcc/rtl-ssa/changes.cc                   |  71 +++++--
 gcc/rtl-ssa/functions.h                  |  11 +-
 5 files changed, 269 insertions(+), 72 deletions(-)