aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-11-17 15:41:06 +0100
committerJan Hubicka <jh@suse.cz>2020-11-17 15:41:06 +0100
commitafa6adbd6c83eeef6d75655140f7c0c9a02a479e (patch)
treea4fdabfcf79d034d24efb534d7cb82adc38a3646 /libcpp
parent18dd295638724b455e072cd790451ace15a3d463 (diff)
downloadgcc-afa6adbd6c83eeef6d75655140f7c0c9a02a479e.zip
gcc-afa6adbd6c83eeef6d75655140f7c0c9a02a479e.tar.gz
gcc-afa6adbd6c83eeef6d75655140f7c0c9a02a479e.tar.bz2
Improve handling of memory operands in ipa-icf 3/4
this patch is based on Maritn's patch https://gcc.gnu.org/legacy-ml/gcc-patches/2019-11/msg02633.html however based on new code that track and compare memory accesses so it can be implemented correctly. As shown here https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558773.html the most common reason for function body being streamed in but merging to fail is the mismatch in base alias set. This patch collect base and ref types ao_alias_ptr types, stream them to WPA and at WPA time hash is produced. Now we can use alias_sets since these these are assumed to be same as ltrans time alias sets. This is currently not always true - but that is pre-existing issue. I will try to produce a testcase and make followup patch on this (that will stream out ODR types with TYPE_CANONICAL that is !ODR as !ODR type). However for this patch this is not a problem since the real alias sets are finer but definitly not coarser. We may make it possible to use canonical type hash and save some streaming, but I think it would be better to wait for next stage1 since it is not completely trivial WRT ODR types: either we hash ODR type names and then hash values would be too coarse for cases we got conflict betwen C and C++ type or we do not stream and will again get into trouble with hash values being too weak. Tried that - we get a lot of types that are struturally same but distinguished by ODR names (from template instantiations). As followup I will add code for merging with mismatched base alias sets. This makes the aforementioned problem about ODR names less pronounced but it is still present on pointer loads/stores which requires REF alias set mismatches. 2020-11-13 Jan Hubicka <hubicka@ucw.cz> Martin Liska <mliska@suse.cz> * ipa-icf.c: Include data-streamer.h and alias.h. (sem_function::sem_function): Initialize memory_access_types and m_alias_sets_hash. (sem_function::hash_stmt): For memory accesses and when going to do lto streaming add base and ref types into memory_access_types. (sem_item_optimizer::write_summary): Stream memory access types. (sem_item_optimizer::read_section): Likewise and also iniitalize m_alias_sets_hash. (sem_item_optimizer::execute): Call sem_item_optimizer::update_hash_by_memory_access_type. (sem_item_optimizer::update_hash_by_memory_access_type): Updat. * ipa-icf.h (sem_function): Add memory_access_types and m_alias_sets_hash.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions