]> git.ipfire.org Git - thirdparty/gcc.git/commit
Avoid redundant entries in modref access lists.
authorJan Hubicka <hubicka@ucw.cz>
Mon, 23 Aug 2021 15:56:51 +0000 (17:56 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Mon, 23 Aug 2021 15:56:51 +0000 (17:56 +0200)
commit6a64964212c8e5e10e474803d06a07514c1069b7
tree87898e739a74c441d898d839b961cd339d0dfe07
parent29c355f76ceeb4639c21acaf52c50d35c8472720
Avoid redundant entries in modref access lists.

In PR101296 Richard noticed that modref is giving up on analysis in milc by
hitting --param=modref-max-accesses limit.  While cleaning up original modref
patch I removed code that tried to do smart things while merging accesses
because it had bugs and wanted to reimplement it later which I later forgot.

This patch adds logic that avoids adding access and its subaccess to the list
which is just waste of memory and compile time.  Incrementally I will add logic
merging the ranges.

gcc/ChangeLog:

2021-08-23  Jan Hubicka  <hubicka@ucw.cz>

* ipa-modref-tree.h (modref_access_node::range_info_useful_p):
Improve range compare.
(modref_access_node::contains): New member function.
(modref_access_node::search): Remove.
(modref_access_node::insert): Be smarter about subaccesses.

gcc/testsuite/ChangeLog:

2021-08-23  Jan Hubicka  <hubicka@ucw.cz>

* gcc.dg/tree-ssa/modref-7.c: New test.
gcc/ipa-modref-tree.h
gcc/testsuite/gcc.dg/tree-ssa/modref-7.c [new file with mode: 0644]