diff options
author | Jan Hubicka <jh@suse.cz> | 2021-11-21 16:15:41 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2021-11-21 16:15:41 +0100 |
commit | 0f5afb626381d19bfced30bc19cf3b03867fa6f5 (patch) | |
tree | 354565fa4803798181e80caca51286efae952d2f /libgcc | |
parent | c8260767aa3b41017b075d8fde3a4065fa637db7 (diff) | |
download | gcc-0f5afb626381d19bfced30bc19cf3b03867fa6f5.zip gcc-0f5afb626381d19bfced30bc19cf3b03867fa6f5.tar.gz gcc-0f5afb626381d19bfced30bc19cf3b03867fa6f5.tar.bz2 |
Improve base tracking in ipa-modref
on exchange2 benchamrk we miss some useful propagation because modref gives
up very early on analyzing accesses through pointers. For example in
int test (int *a)
{
int i;
for (i=0; a[i];i++);
return i+a[i];
}
We are not able to determine that a[i] accesses are relative to a.
This is because get_access requires the SSA name that is in MEM_REF to be
PARM_DECL while on other places we use ipa-prop helper to work out the proper
base pointers.
This patch commonizes the code in get_access and parm_map_for_arg so both
use the check properly and extends it to also figure out that newly allocated
memory is not a side effect to caller.
gcc/ChangeLog:
2021-11-21 Jan Hubicka <hubicka@ucw.cz>
PR ipa/103227
* ipa-modref.c (parm_map_for_arg): Rename to ...
(parm_map_for_ptr): .. this one; handle static chain and calls to
malloc functions.
(modref_access_analysis::get_access): Use parm_map_for_ptr.
(modref_access_analysis::process_fnspec): Update.
(modref_access_analysis::analyze_load): Update.
(modref_access_analysis::analyze_store): Update.
gcc/testsuite/ChangeLog:
2021-11-21 Jan Hubicka <hubicka@ucw.cz>
PR ipa/103227
* gcc.dg/tree-ssa/modref-15.c: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions