]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/114855 - slow VRP due to equiv oracle queries
authorRichard Biener <rguenther@suse.de>
Tue, 24 Sep 2024 09:47:26 +0000 (11:47 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 25 Sep 2024 06:57:55 +0000 (08:57 +0200)
For the testcase in PR114855 VRP takes 320.41s (23%) (after mitigating
backwards threader slowness).  This is mostly due to the bitmap check
in equiv_oracle::find_equiv_dom.  The following turns this bitmap
to tree view, trading the linear search for a O(log N) one which
improves VRP time to 54.54s (5%).

PR tree-optimization/114855
* value-relation.cc (equiv_oracle::equiv_oracle): Switch
m_equiv_set to tree view.

gcc/value-relation.cc

index 45722fcd13a6c08ad154141b59a91dba8bb9d091..d6ad2dd984f6bfbbb1f534099c47d9c1bc7092b4 100644 (file)
@@ -321,6 +321,7 @@ equiv_oracle::equiv_oracle ()
   m_equiv.create (0);
   m_equiv.safe_grow_cleared (last_basic_block_for_fn (cfun) + 1);
   m_equiv_set = BITMAP_ALLOC (&m_bitmaps);
+  bitmap_tree_view (m_equiv_set);
   obstack_init (&m_chain_obstack);
   m_self_equiv.create (0);
   m_self_equiv.safe_grow_cleared (num_ssa_names + 1);