]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Extend early-ra splitting of single-block regions
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 18 Nov 2024 19:32:50 +0000 (19:32 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 18 Nov 2024 19:32:50 +0000 (19:32 +0000)
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.

gcc/config/aarch64/aarch64-early-ra.cc

index 79ac7b099ebb4dc8bc62e0fde366e4ae0da68a31..33d82ea64c2a8bda6c2cb680d4a0f5f00df92c3d 100644 (file)
@@ -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;