mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-19 09:05:17 +08:00
5bc4cb0412
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. |
||
---|---|---|
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.