diff options
author | Vladimir N. Makarov <vmakarov@redhat.com> | 2023-02-09 15:18:48 -0500 |
---|---|---|
committer | Vladimir N. Makarov <vmakarov@redhat.com> | 2023-02-09 16:48:21 -0500 |
commit | 10827a92f1a8c3207b327515f77845b34c1d9512 (patch) | |
tree | 9ede1ff37a8cbdba928e8451d259f31bed2c1d4f /gcc/ira.h | |
parent | a618b45ac41cf480f54c4fa4014aed6218931290 (diff) | |
download | gcc-10827a92f1a8c3207b327515f77845b34c1d9512.zip gcc-10827a92f1a8c3207b327515f77845b34c1d9512.tar.gz gcc-10827a92f1a8c3207b327515f77845b34c1d9512.tar.bz2 |
RA: Implement reuse of equivalent memory for caller saves optimization (2nd version)
The test pr103541.c shows opportunity to reuse memory with constant address for
caller saves optimization for constant or pure function call. The patch
implements the memory reuse.
PR rtl-optimization/103541
PR rtl-optimization/108711
gcc/ChangeLog:
* ira.h (struct ira_reg_equiv_s): Add new field caller_save_p.
* ira.cc (validate_equiv_mem): Check memref address variance.
(no_equiv): Clear caller_save_p flag.
(update_equiv_regs): Define caller save equivalence for
valid_combine.
(setup_reg_equiv): Clear defined_p flag for caller save equivalence.
* lra-constraints.cc (lra_copy_reg_equiv): Add new arg
call_save_p. Use caller save equivalence depending on the arg.
(split_reg): Adjust the call.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr103541.c: New.
* g++.target/i386/pr108711.C: New.
Diffstat (limited to 'gcc/ira.h')
-rw-r--r-- | gcc/ira.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -175,8 +175,11 @@ extern struct target_ira *this_target_ira; /* Major structure describing equivalence info for a pseudo. */ struct ira_reg_equiv_s { - /* True if we can use this equivalence. */ + /* True if we can use this as a general equivalence. */ bool defined_p; + /* True if we can use this equivalence only for caller save/restore + location. */ + bool caller_save_p; /* True if the usage of the equivalence is profitable. */ bool profitable_p; /* Equiv. memory, constant, invariant, and initializing insns of |