https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108697

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Created attachment 54420
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54420&action=edit
reuse path_range_query SSA cache for all of back_threader class

Off of the top of my head (i.e. probably very broken ;-)), this is what I had
in mind...  Share a cache between subsequent instantiations of
path_range_query.

Note the change to the set_cache:

 path_range_query::set_cache (const vrange &r, tree name)
 {
   unsigned v = SSA_NAME_VERSION (name);
-  bitmap_set_bit (m_has_cache_entry, v);
+  if (bitmap_set_bit (m_has_cache_entry, v))
+    m_cache->clear_global_range (name);
   m_cache->set_global_range (name, r);
 }

Since we're sharing the cache, make sure we nuke whatever it had there before,
otherwise set_global_range will try to reuse the slot if it thinks it fits. 
Although...maybe that's not even necessary.  I'm not sure...you'd have to play
around with it, but I think the general idea would work.

Reply via email to