mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 16:21:27 +08:00
cunroll-1.c: New testcase.
* gcc.dg/tree-ssa/cunroll-1.c: New testcase. * gcc.dg/tree-ssa/cunroll-2.c: New testcase. * gcc.dg/tree-ssa/cunroll-3.c: New testcase. * gcc.dg/tree-ssa/cunroll-4.c: New testcase. * gcc.dg/tree-ssa/cunroll-5.c: New testcase. From-SVN: r192608
This commit is contained in:
parent
b11f0116d6
commit
c8379865b3
13
gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c
Normal file
13
gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
|
||||
int a[2];
|
||||
test(int c)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<c;i++)
|
||||
a[i]=5;
|
||||
}
|
||||
/* Array bounds says the loop will not roll much. */
|
||||
/* { dg-final { scan-tree-dump "Unrolled loop 1 completely .duplicated 1 times.." "cunroll"} } */
|
||||
/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "cunroll"} } */
|
||||
/* { dg-final { cleanup-tree-dump "cunroll" } } */
|
16
gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c
Normal file
16
gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c
Normal file
@ -0,0 +1,16 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
|
||||
int a[2];
|
||||
test(int c)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<c;i++)
|
||||
{
|
||||
a[i]=5;
|
||||
if (test2())
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* We are not able to get rid of the final conditional because the loop has two exits. */
|
||||
/* { dg-final { scan-tree-dump "Unrolled loop 1 completely .duplicated 2 times.." "cunroll"} } */
|
||||
/* { dg-final { cleanup-tree-dump "cunroll" } } */
|
15
gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c
Normal file
15
gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-tree-cunrolli-details" } */
|
||||
int a[1];
|
||||
test(int c)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<c;i++)
|
||||
{
|
||||
a[i]=5;
|
||||
}
|
||||
}
|
||||
/* If we start duplicating headers prior curoll, this loop will have 0 iterations. */
|
||||
|
||||
/* { dg-final { scan-tree-dump "Unrolled loop 1 completely .duplicated 1 times.." "cunrolli"} } */
|
||||
/* { dg-final { cleanup-tree-dump "cunrolli" } } */
|
21
gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
Normal file
21
gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
Normal file
@ -0,0 +1,21 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
|
||||
int a[1];
|
||||
test(int c)
|
||||
{
|
||||
int i=0,j;
|
||||
for (i=0;i<c;i++)
|
||||
{
|
||||
for (j=0;j<c;j++)
|
||||
{
|
||||
a[i]=5;
|
||||
test2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We should do this as part of cunrolli, but our cost model do not take into account early exit
|
||||
from the last iteration. */
|
||||
/* { dg-final { scan-tree-dump "Turned loop 1 to non-loop; it never loops." "cunrolli"} } */
|
||||
/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "cunrolli"} } */
|
||||
/* { dg-final { cleanup-tree-dump "cunroll" } } */
|
14
gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c
Normal file
14
gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
|
||||
int *a;
|
||||
test(int c)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<6;i++)
|
||||
a[i]=5;
|
||||
}
|
||||
/* Basic testcase for complette unrolling. */
|
||||
/* { dg-final { scan-tree-dump "Unrolled loop 1 completely .duplicated 5 times.." "cunroll"} } */
|
||||
/* { dg-final { scan-tree-dump "Exit condition of peeled iterations was eliminated." "cunroll"} } */
|
||||
/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "cunroll"} } */
|
||||
/* { dg-final { cleanup-tree-dump "cunroll" } } */
|
Loading…
x
Reference in New Issue
Block a user