aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2021-11-25 17:58:12 +0100
committerMartin Jambor <mjambor@suse.cz>2021-11-25 18:16:31 +0100
commit5bc4cb04127a4805b6228b0a6cbfebdbd61314d2 (patch)
treecd461b42f093859855f48562fd4279d11ace9bc4 /libgcc
parent415f9ee404dc9e8ae1cade160a33400b10abb18a (diff)
downloadgcc-5bc4cb04127a4805b6228b0a6cbfebdbd61314d2.zip
gcc-5bc4cb04127a4805b6228b0a6cbfebdbd61314d2.tar.gz
gcc-5bc4cb04127a4805b6228b0a6cbfebdbd61314d2.tar.bz2
ipa: Teach IPA-CP transformation about IPA-SRA modifications (PR 103227)
PR 103227 exposed an issue with ordering of transformations of IPA passes. IPA-CP can create clones for constants passed by reference and at the same time IPA-SRA can also decide that the parameter does not need to be a pointer (or an aggregate) and plan to convert it into (a) simple scalar(s). Because no intermediate clone is created just for the purpose of ordering the transformations and because IPA-SRA transformation is implemented as part of clone materialization, the IPA-CP transformation happens only afterwards, reversing the order of the transformations compared to the ordering of analyses. IPA-CP transformation looks at planned substitutions for values passed by reference or in aggregates but finds that all the relevant parameters no longer exist. Currently it subsequently simply gives up, leading to clones created for no good purpose (and huge regression of 548.exchange_r. This patch teaches it recognize the situation, look up the new scalarized parameter and perform value substitution on it. On my desktop this has recovered the lost exchange2 run-time (and some more). I have disabled IPA-SRA in a Fortran testcase so that the dumping from the transformation phase can still be matched in order to verify that IPA-CP understands the IL after verifying that it does the right thing also with IPA-SRA. gcc/ChangeLog: 2021-11-23 Martin Jambor <mjambor@suse.cz> PR ipa/103227 * ipa-prop.h (ipa_get_param): New overload. Move bits of the existing one to the new one. * ipa-param-manipulation.h (ipa_param_adjustments): New member function get_updated_index_or_split. * ipa-param-manipulation.c (ipa_param_adjustments::get_updated_index_or_split): New function. * ipa-prop.c (adjust_agg_replacement_values): Reimplement, add capability to identify scalarized parameters and perform substitution on them. (ipcp_transform_function): Create descriptors earlier, handle new return values of adjust_agg_replacement_values. gcc/testsuite/ChangeLog: 2021-11-23 Martin Jambor <mjambor@suse.cz> PR ipa/103227 * gcc.dg/ipa/pr103227-1.c: New test. * gcc.dg/ipa/pr103227-3.c: Likewise. * gcc.dg/ipa/pr103227-2.c: Likewise. * gfortran.dg/pr53787.f90: Disable IPA-SRA.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions