https://gcc.gnu.org/g:40d0f79577e7011c19b6ef16ef921eeef6737462

commit r16-6155-g40d0f79577e7011c19b6ef16ef921eeef6737462
Author: Maxim Kuvyrkov <[email protected]>
Date:   Mon Dec 15 16:36:10 2025 +0100

    Haifa scheduler: Prevent splitting of fusion pairs in dispatch scheduling
    
    gcc/Changelog
    
            * haifa-sched.cc (choose_ready): Don't require dfa_lookahead <= 0
            to schedule SCHED_GROUP_P insns first.

Diff:
---
 gcc/haifa-sched.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/haifa-sched.cc b/gcc/haifa-sched.cc
index 63eb06b2d820..58e04eee0dba 100644
--- a/gcc/haifa-sched.cc
+++ b/gcc/haifa-sched.cc
@@ -6132,8 +6132,13 @@ choose_ready (struct ready_list *ready, bool 
first_cycle_insn_p,
       return -1;
     }
 
-  if (dfa_lookahead <= 0 || SCHED_GROUP_P (ready_element (ready, 0))
+  if (SCHED_GROUP_P (ready_element (ready, 0))
       || DEBUG_INSN_P (ready_element (ready, 0)))
+    {
+      *insn_ptr = ready_remove_first (ready);
+      return 0;
+    }
+  else if (dfa_lookahead <= 0)
     {
       if (targetm.sched.dispatch (NULL, IS_DISPATCH_ON))
        *insn_ptr = ready_remove_first_dispatch (ready);

Reply via email to