https://gcc.gnu.org/g:279475fd7236a9e4ed1ecb634f82a2bc7c895cc8

commit r15-5422-g279475fd7236a9e4ed1ecb634f82a2bc7c895cc8
Author: Richard Sandiford <richard.sandif...@arm.com>
Date:   Mon Nov 18 19:32:50 2024 +0000

    aarch64: Extend early-ra splitting of single-block regions
    
    When early-ra treats a block as an isolated allocation region,
    it opportunistically splits the block into smaller regions
    at points where no FPRs or FPR allocnos are live.  Previously
    it only did this if m_allocation_successful, since the contrary
    included cases in which the live range information wasn't trustworthy.
    
    After earlier patches, we should now be able to trust the live range
    information whenever m_accurate_live_ranges is true.  This means that
    we can split the block into regions even if allocation failed for the
    current (sub)region.
    
    This is just something I noticed by inspection.  I don't have
    a particular test case for it.
    
    gcc/
            * config/aarch64/aarch64-early-ra.cc
            (early_ra::process_block): Check m_accurate_live_ranges
            rather than m_allocation_successful when deciding whether
            to split a block into multiple regions.  Skip over subregions
            that we decide not to allocate.

Diff:
---
 gcc/config/aarch64/aarch64-early-ra.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-early-ra.cc 
b/gcc/config/aarch64/aarch64-early-ra.cc
index 79ac7b099ebb..33d82ea64c2a 100644
--- a/gcc/config/aarch64/aarch64-early-ra.cc
+++ b/gcc/config/aarch64/aarch64-early-ra.cc
@@ -3575,14 +3575,17 @@ early_ra::process_block (basic_block bb, bool 
is_isolated)
       // See whether we have a complete region, with no remaining live
       // allocnos.
       if (is_isolated
+         && m_accurate_live_ranges
          && bitmap_empty_p (m_live_allocnos)
          && m_live_fprs == 0
-         && m_allocation_successful
          && !m_allocnos.is_empty ())
        {
          rtx_insn *prev_insn = PREV_INSN (insn);
-         m_insn_ranges.safe_push ({ start_insn, prev_insn });
-         process_region ();
+         if (m_allocation_successful)
+           {
+             m_insn_ranges.safe_push ({ start_insn, prev_insn });
+             process_region ();
+           }
          start_new_region ();
          is_first = true;
          start_insn = prev_insn;

Reply via email to