-
- Downloads
Feed results of IPA-CP into tree value numbering
PRs 68930 and 92497 show that when IPA-CP figures out constants in aggregate parameters or when passed by reference but the loads happen in an inlined function the information is lost. This happens even when the inlined function itself was known to have - or even cloned to have - such constants in incoming parameters because the transform phase of IPA passes is not run on them. See discussion in the bugs for reasons why. Honza suggested that we can plug the results of IPA-CP analysis into value numbering, so that FRE can figure out that some loads fetch known constants. This is what this patch attempts to do. The patch does not attempt to populate partial_defs with information from IPA-CP, this can be hopefully added as a follow-up. gcc/ChangeLog: 2023-08-11 Martin Jambor <mjambor@suse.cz> PR ipa/68930 PR ipa/92497 * ipa-prop.h (ipcp_get_aggregate_const): Declare. * ipa-prop.cc (ipcp_get_aggregate_const): New function. (ipcp_transform_function): Do not deallocate transformation info. * tree-ssa-sccvn.cc: Include alloc-pool.h, symbol-summary.h and ipa-prop.h. (vn_reference_lookup_2): When hitting default-def vuse, query IPA-CP transformation info for any known constants. gcc/testsuite/ChangeLog: 2023-06-07 Martin Jambor <mjambor@suse.cz> PR ipa/68930 PR ipa/92497 * gcc.dg/ipa/pr92497-1.c: New test. * gcc.dg/ipa/pr92497-2.c: Likewise.
Showing
- gcc/ipa-prop.cc 28 additions, 5 deletionsgcc/ipa-prop.cc
- gcc/ipa-prop.h 3 additions, 0 deletionsgcc/ipa-prop.h
- gcc/testsuite/gcc.dg/ipa/pr92497-1.c 26 additions, 0 deletionsgcc/testsuite/gcc.dg/ipa/pr92497-1.c
- gcc/testsuite/gcc.dg/ipa/pr92497-2.c 26 additions, 0 deletionsgcc/testsuite/gcc.dg/ipa/pr92497-2.c
- gcc/tree-ssa-sccvn.cc 33 additions, 1 deletiongcc/tree-ssa-sccvn.cc
Loading
Please register or sign in to comment