-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graphite: Extend SCoP detection dump output
Extend dump output to make understanding why Graphite rejects to include a loop in a SCoP easier (for GCC developers). gcc/ChangeLog: * graphite-scop-detection.cc (scop_detection::can_represent_loop): Output reason for failure to dump file. (scop_detection::harmful_loop_in_region): Likewise. (scop_detection::graphite_can_represent_expr): Likewise. (scop_detection::stmt_has_simple_data_refs_p): Likewise. (scop_detection::stmt_simple_for_scop_p): Likewise. (print_sese_loop_numbers): New function. (scop_detection::add_scop): Use from here. gcc/testsuite/ChangeLog: * gcc.dg/graphite/scop-22a.c: New test.
- Loading branch information
Frederik Harwath
committed
May 18, 2022
1 parent
65851d6
commit 21e2bc9
Showing
2 changed files
with
219 additions
and
21 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,56 @@ | ||
/* { dg-require-effective-target size32plus } */ | ||
double u[1782225]; | ||
|
||
void foo(int N, int *res) | ||
{ | ||
int i, j; | ||
double a, b; | ||
double sum = 0.0; | ||
|
||
for (j = 3; j < N; j = j * j) | ||
{ | ||
sum += a + b; | ||
} | ||
|
||
/* Next two loops form first SCoP */ | ||
for (i = 0; i < N; i++) | ||
sum += u[i]; | ||
|
||
for (i = 0; i < N; i++) | ||
{ | ||
a = u[i]; | ||
u[i] = i * i; | ||
b = u[i]; | ||
sum += a + b; | ||
} | ||
|
||
for (j = 3; j < N; j = j * j) | ||
{ | ||
sum += a + b; | ||
} | ||
|
||
for (j = 3; j < N; j = j * j) | ||
{ | ||
sum += a + b; | ||
} | ||
|
||
/* Next two loop-nests form second SCoP */ | ||
for (i = 0; i < N; i++) | ||
sum += u[i]; | ||
|
||
for (i = 0; i < N; i++) | ||
for (j = 0; j < N; j++) | ||
{ | ||
a = u[i]; | ||
u[i] = i * i; | ||
b = u[j]; | ||
sum += a + b; | ||
} | ||
|
||
*res = sum + N; | ||
} | ||
|
||
/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */ | ||
/* { dg-final { scan-tree-dump-times "Loops in SCoP" 2 "graphite"} } */ | ||
/* { dg-final { scan-tree-dump "Loops in SCoP: 2, 3" "graphite"} } */ | ||
/* { dg-final { scan-tree-dump "Loops in SCoP: 6, 7, 8" "graphite"} } */ |