forked from wangliu-iscas/gcc-patch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipa-sra: Move caller->callee propagation before callee->caller one
Hi, I'm re-posting patches which I have posted at the end of stage 1 but which have not passed review yet. 8<-------------------------------------------------------------------- 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. Bootstrapped and tested individually when I originally posted it and now bootstrapped and LTO-bootstrapped and tested as part of the whole series. OK for master? gcc/ChangeLog: 2022-11-11 Martin Jambor <mjambor@suse.cz> * ipa-sra.c (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
- Loading branch information
1 parent
8ee5084
commit 814baf3
Showing
2 changed files
with
78 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-O2 -Wmaybe-uninitialized -Werror" } */ | ||
|
||
int cbos(); | ||
static int aos() { | ||
cbos(); | ||
return 0; | ||
} | ||
int cbos_ptr; | ||
long cbos_psize; | ||
int cbos() { | ||
if (cbos_ptr) | ||
return aos(); | ||
if (cbos_psize) | ||
return 1; | ||
return 0; | ||
} |