diff mbox series

[5/6] aarch64: Extend early-ra splitting of single-block regions

Message ID 20241113103608.1937313-6-richard.sandiford@arm.com
State New
Headers show
Series aarch64: Some tweaks to early-ra | expand

Commit Message

Richard Sandiford Nov. 13, 2024, 10:36 a.m. UTC
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 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gcc/config/aarch64/aarch64-early-ra.cc b/gcc/config/aarch64/aarch64-early-ra.cc
index 79ac7b099eb..33d82ea64c2 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;