mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve AutoFDO count propagation algorithm
When a basic block A has been annotated with a count and it has only one successor (or predecessor) B, we can propagate the A's count to B. The algoritm without this change could leave B without an annotation if B had other unannotated predecessors (or successors). For example, in the test case I added, the loop header block was left unannotated, which prevented loop unrolling. gcc/ChangeLog: * auto-profile.c (afdo_propagate_edge): Improve count propagation algorithm. gcc/testsuite/ChangeLog: * gcc.dg/tree-prof/init-array.c: New test for unrolling inner loops.
- vendors/ARM/release-12.3.rel1
- releases/gcc-14.2.0
- releases/gcc-14.1.0
- releases/gcc-13.3.0
- releases/gcc-13.2.0
- releases/gcc-13.1.0
- releases/gcc-12.4.0
- releases/gcc-12.3.0
- releases/gcc-12.2.0
- releases/gcc-12.1.0
- release-12.2.mpacbti-rel1
- release-12.2.mpacbti-bet1
- basepoints/gcc-15
- basepoints/gcc-14
- basepoints/gcc-13
- Thesis
1 parent
3a580f9
commit 3d9e676
Showing
2 changed files
with
61 additions
and
2 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,43 @@ | ||
/* { dg-options "-O3 -fdump-tree-cunrolli-details" } */ | ||
|
||
static int s[10][10][10]; | ||
static int d[10][10][10]; | ||
|
||
__attribute__((noipa)) | ||
int array() | ||
{ | ||
int i; | ||
register int j, k; | ||
for (i = 0; i < 10; i++) | ||
for (j = 0; j < 10; j++) | ||
for (k = 0; k < 10; k++) | ||
d[i][j][k] = s[i][j][k]; | ||
|
||
return(0); | ||
} | ||
|
||
__attribute__((noipa)) | ||
void TestBench() | ||
{ | ||
for (int i = 0; i < 150000; ++i) | ||
{ | ||
array(); | ||
} | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
|
||
TestBench(); | ||
|
||
if (d[9][9][9] == 0 && s[9][9][9] == 0) | ||
{ | ||
return 0; | ||
} | ||
else | ||
{ | ||
return -1; | ||
} | ||
} | ||
|
||
/* { dg-final-use { scan-tree-dump-times "loop with 10 iterations completely unrolled" 2 "cunrolli"} } */ |