On 11/8/21 10:05 AM, Martin Liška wrote:
On 9/28/21 22:39, Andrew MacLeod wrote:
In Theory, modifying the IL should be fine, it happens already in places, but its not extensively tested under those conditions yet.

Hello Andrew.

I've just tried using a global gimple_ranger and it crashes when loop unswitching duplicates
some BBs.

ah, ok, so the default on-entry cache for ranger doesn't expect to see the number of BBs to increase.  .  I can change this to grow, but I want to avoid too many grows.  This test case looks like it grows the number of BBs from 24 to somewhere north of 90..  Do you have any idea in advance how many BBs you will be adding?  Although Im not sure how to make such a suggestion anyway .  Ill work something out.  The sparse cache has no such issue, but you will lose precision so we don't want to trigger on that anyway.

As work around for the moment to keep you going, heres a patch which simply starts with 256 extra spaces, so that should allow you to continue while I fix this properly to grow.  and you can see if things continue to work as expected.  You can increase that number as you see fit

I'll put in a proper fix in a bit.


diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index e5591bab0ef..6a3dcfadf98 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -220,7 +220,7 @@ sbr_vector::sbr_vector (tree t, irange_allocator *allocator)
   gcc_checking_assert (TYPE_P (t));
   m_type = t;
   m_irange_allocator = allocator;
-  m_tab_size = last_basic_block_for_fn (cfun) + 1;
+  m_tab_size = last_basic_block_for_fn (cfun) + 256;
   m_tab = (irange **)allocator->get_memory (m_tab_size * sizeof (irange *));
   memset (m_tab, 0, m_tab_size * sizeof (irange *));
 

Reply via email to