public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] [PR108754] RA: Use caller save equivalent memory only for LRA
@ 2023-02-10 17:42 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2023-02-10 17:42 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 235 bytes --]

The following patch should  solve

   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108754

The patch simply switches off a new optimization for targets using the 
old reload pass.

The patch was successfully bootstrapped on x86-64.


[-- Attachment #2: pr108754.patch --]
[-- Type: text/x-patch, Size: 1095 bytes --]

commit 7757567358a84c3774cb972350bd7ea299daaa8d
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Fri Feb 10 12:17:07 2023 -0500

    RA: Use caller save equivalent memory only for LRA
    
    Recently I submitted a patch to reuse memory with constant address for
    caller saves optimization for constant or pure function call.  It
    seems to work only for targets using LRA instead of the old reload
    pass.  So the patch switches off this optimization when the old reload
    pass is used.
    
            PR middle-end/108754
    
    gcc/ChangeLog:
    
            * ira.cc (update_equiv_regs): Set up ira_reg_equiv for
            valid_combine only when ira_use_lra_p is true.

diff --git a/gcc/ira.cc b/gcc/ira.cc
index d0b6ea062e8..9f9af808f63 100644
--- a/gcc/ira.cc
+++ b/gcc/ira.cc
@@ -3773,7 +3773,7 @@ update_equiv_regs (void)
 		    {
 		      note = set_unique_reg_note (insn, REG_EQUIV, replacement);
 		    }
-		  else
+		  else if (ira_use_lra_p)
 		    {
 		      /* We still can use this equivalence for caller save
 			 optimization in LRA.  Mark this.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-10 17:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 17:42 [pushed] [PR108754] RA: Use caller save equivalent memory only for LRA Vladimir Makarov

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