]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa-sra: Move caller->callee propagation before callee->caller one
authorMartin Jambor <mjambor@suse.cz>
Tue, 13 Dec 2022 23:33:06 +0000 (00:33 +0100)
committerMartin Jambor <mjambor@suse.cz>
Tue, 13 Dec 2022 23:58:18 +0000 (00:58 +0100)
commit803a91330bf20174d1cf6a164cafd97405655b82
treef2f10edbe80cf912a263b00ecf6e40a285785fe6
parent10478270fe0c39c59eb0f35d19356a63bdf3a2ad
ipa-sra: Move caller->callee propagation before callee->caller one

This patch does not do any functional changes, it merely moves
top-down propagation in the IPA-SRA WPA phase before bottom-up one.
This also meant moving some preliminary checks from the latter to the
former - where they need to be in their own loop over each SCC because
the subsequent one looks at callers.

Currently the propagations are independent (top-down is used for
return value rermoval, bottom-up for parameter removal and splitting)
but subsequent patches will introduce flags about parameters which
should be propagated from callers first and used in splitting.  I
separated this change to test ir independently and make those
subsequent patches cleaner.

While at it, I also replaced couple of FOR_EACH_VEC_ELT macros with
C++11 style iteration.

gcc/ChangeLog:

2022-11-11  Martin Jambor  <mjambor@suse.cz>

* ipa-sra.cc (ipa_sra_analysis): Move top-down analysis before
bottom-up analysis.  Replace FOR_EACH_VEC_ELT with C++11 iteration.

gcc/testsuite/ChangeLog:

2021-12-14  Martin Jambor  <mjambor@suse.cz>

* gcc.dg/ipa/ipa-sra-25.c: New test
gcc/ipa-sra.cc
gcc/testsuite/gcc.dg/ipa/ipa-sra-25.c [new file with mode: 0644]