diff options
author | Jan Hubicka <jh@suse.cz> | 2020-10-14 11:44:30 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-10-14 11:44:30 +0200 |
commit | c7b6a7587f215e913cec9ed523bf32bb0405fd3f (patch) | |
tree | e45f2f02121bc6526d9504f484dec745dea32fc9 /gcc/ipa-modref.c | |
parent | 87d75a11a5cb93668ae0bf6d97030e01b2eae3f2 (diff) | |
download | gcc-c7b6a7587f215e913cec9ed523bf32bb0405fd3f.zip gcc-c7b6a7587f215e913cec9ed523bf32bb0405fd3f.tar.gz gcc-c7b6a7587f215e913cec9ed523bf32bb0405fd3f.tar.bz2 |
Support ofsetted parameters in local modref
2020-10-14 Jan Hubicka <hubicka@ucw.cz>
* doc/invoke.texi: (ipa-jump-function-lookups): Document param.
* ipa-modref.c (merge_call_side_effects): Use
unadjusted_ptr_and_unit_offset.
* ipa-prop.c (unadjusted_ptr_and_unit_offset): New function.
* ipa-prop.h (unadjusted_ptr_and_unit_offset): Declare.
* params.opt: (-param-ipa-jump-function-lookups): New.
Diffstat (limited to 'gcc/ipa-modref.c')
-rw-r--r-- | gcc/ipa-modref.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 771a0a8..a6dfe1f 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -531,6 +531,10 @@ merge_call_side_effects (modref_summary *cur_summary, for (unsigned i = 0; i < gimple_call_num_args (stmt); i++) { tree op = gimple_call_arg (stmt, i); + bool offset_known; + poly_int64 offset; + + offset_known = unadjusted_ptr_and_unit_offset (op, &op, &offset); if (TREE_CODE (op) == SSA_NAME && SSA_NAME_IS_DEFAULT_DEF (op) && TREE_CODE (SSA_NAME_VAR (op)) == PARM_DECL) @@ -547,15 +551,23 @@ merge_call_side_effects (modref_summary *cur_summary, index++; } parm_map[i].parm_index = index; - parm_map[i].parm_offset_known = true; - parm_map[i].parm_offset = 0; + parm_map[i].parm_offset_known = offset_known; + parm_map[i].parm_offset = offset; } else if (points_to_local_or_readonly_memory_p (op)) parm_map[i].parm_index = -2; else parm_map[i].parm_index = -1; if (dump_file) - fprintf (dump_file, " %i", parm_map[i].parm_index); + { + fprintf (dump_file, " %i", parm_map[i].parm_index); + if (parm_map[i].parm_offset_known) + { + fprintf (dump_file, " offset:"); + print_dec ((poly_int64_pod)parm_map[i].parm_offset, + dump_file, SIGNED); + } + } } if (dump_file) fprintf (dump_file, "\n"); |