aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.h
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@redhat.com>2023-02-07 08:27:36 -0500
committerVladimir N. Makarov <vmakarov@redhat.com>2023-02-07 08:46:35 -0500
commitf661c0bb6371f355966a67b5ce71398e80792948 (patch)
tree2fed39477f056cd4366a0ededc2e6f8d580f9e7e /gcc/ira.h
parent295adfc9ed20468cdaba3afe258d57b58a8df792 (diff)
downloadgcc-f661c0bb6371f355966a67b5ce71398e80792948.zip
gcc-f661c0bb6371f355966a67b5ce71398e80792948.tar.gz
gcc-f661c0bb6371f355966a67b5ce71398e80792948.tar.bz2
RA: Implement reuse of equivalent memory for caller saves optimization
The test case 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 gcc/ChangeLog: * ira.h (struct ira_reg_equiv_s): Add new field caller_save_p. * ira.cc (validate_equiv_mem): Check memref address variance. (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.
Diffstat (limited to 'gcc/ira.h')
-rw-r--r--gcc/ira.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ira.h b/gcc/ira.h
index 58b50db..3d35025 100644
--- a/gcc/ira.h
+++ b/gcc/ira.h
@@ -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