OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [autopar/] [outer-6.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
3
 
4
void abort (void);
5
 
6
int x[500][500];
7
int y[500];
8
int g_sum=0;
9
 
10
__attribute__((noinline))
11
void init (int i, int j)
12
{
13
  x[i][j]=1;
14
}
15
 
16
__attribute__((noinline))
17
void parloop (int N)
18
{
19
  int i, j;
20
  int sum;
21
 
22
  /* Outer loop reduction, outerloop is parallelized.  */
23
  sum=0;
24
  for (i = 0; i < N; i++)
25
  {
26
    for (j = 0; j < N; j++)
27
      y[i]=x[i][j];
28
    sum += y[i];
29
  }
30
  g_sum = sum;
31
}
32
 
33
int main(void)
34
{
35
  int i,j;
36
  for (i = 0; i < 500; i++)
37
    for (j = 0; j < 500; j++)
38
      init(i, j);
39
 
40
  parloop(500);
41
 
42
  return 0;
43
}
44
 
45
 
46
/* Check that outer loop is parallelized.  */
47
/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
48
/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 0 "parloops" } } */
49
/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
50
/* { dg-final { cleanup-tree-dump "parloops" } } */
51
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.