public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed][PR115013][LRA]: Modify register starvation recognition
@ 2024-05-13 15:19 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2024-05-13 15:19 UTC (permalink / raw)
  To: gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 128 bytes --]

The following patch fixes

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

Successfully tested and bootstrapped on x86-64.

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

commit 44430ef3d8ba75692efff5f6969d5610134566d3
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Mon May 13 10:12:11 2024 -0400

    [PR115013][LRA]: Modify register starvation recognition
    
      My recent patch to recognize reg starvation resulted in few GCC test
    failures.  The following patch fixes this by using more accurate
    starvation calculation and ignoring small reg classes.
    
    gcc/ChangeLog:
    
            PR rtl-optimization/115013
            * lra-constraints.cc (process_alt_operands): Update all_used_nregs
            only for winreg.  Ignore reg starvation for small reg classes.

diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index e945a4da451..92b343fa99a 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -2674,8 +2674,9 @@ process_alt_operands (int only_alternative)
 	      if (early_clobber_p
 		  || curr_static_id->operand[nop].type != OP_OUT)
 		{
-		  all_used_nregs
-		    += ira_reg_class_min_nregs[this_alternative][mode];
+		  if (winreg)
+		    all_used_nregs
+		      += ira_reg_class_min_nregs[this_alternative][mode];
 		  all_this_alternative
 		    = (reg_class_subunion
 		       [all_this_alternative][this_alternative]);
@@ -3250,6 +3251,7 @@ process_alt_operands (int only_alternative)
 	  overall += LRA_MAX_REJECT;
 	}
       if (all_this_alternative != NO_REGS
+	  && !SMALL_REGISTER_CLASS_P (all_this_alternative)
 	  && all_used_nregs != 0 && all_reload_nregs != 0
 	  && (all_used_nregs + all_reload_nregs + 1
 	      >= ira_class_hard_regs_num[all_this_alternative]))

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

only message in thread, other threads:[~2024-05-13 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13 15:19 [pushed][PR115013][LRA]: Modify register starvation recognition 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).