]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Limit equivalency processing in rangers cache.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 8 Aug 2024 20:34:15 +0000 (16:34 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Fri, 9 Aug 2024 18:49:46 +0000 (14:49 -0400)
When the number of block exceed VRP's sparse threshold, do not query all
equivalencies during cache filling.   This can be expensive for unknown
benefit.

PR tree-optimization/114855
* gimple-range-cache.cc (ranger_cache::fill_block_cache): Do not
process equivalencies if the number of blocks is too high.

gcc/gimple-range-cache.cc

index 0fffd7c16a1c0f9547ee231214c3ebbdf835bd17..43949894cbed84394317fd262fa994d14da48bdc 100644 (file)
@@ -1486,6 +1486,14 @@ ranger_cache::fill_block_cache (tree name, basic_block bb, basic_block def_bb)
       tree equiv_name;
       relation_kind rel;
       int prec = TYPE_PRECISION (type);
+      // If there are too many basic blocks, do not attempt to process
+      // equivalencies.
+      if (last_basic_block_for_fn (cfun) > param_vrp_sparse_threshold)
+       {
+         m_on_entry.set_bb_range (name, bb, block_result);
+         gcc_checking_assert (m_workback.length () == start_length);
+         return;
+       }
       FOR_EACH_PARTIAL_AND_FULL_EQUIV (m_relation, bb, name, equiv_name, rel)
        {
          basic_block equiv_bb = gimple_bb (SSA_NAME_DEF_STMT (equiv_name));