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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [autopar/] [pr49960.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
#include <stdio.h>
5
#define MB 100
6
#define NA 450
7
#define MA 400
8
 
9
int T[MA][MB],A[MA][NA],B[MB][NA];
10
void MRTRBR(int MA_1, int NA_1, int MB_1)
11
{
12
  int i,j, t,k;
13
 
14
  /* The outer most loop is not parallel because for different k's there
15
     is write-write dependency for T[i][j].  */
16
 
17
  /* The two inner loops don't get parallelized due to low number of
18
     iterations.  */
19
 
20
  for (k = 3; k < NA_1; k++)
21
    for (i = 3; i < MA_1; i++)
22
      for (j = 3; j < MB_1; j++)
23
        {
24
          t = T[i][j];
25
          T[i][j] = t+2+A[i][k]*B[j][k];
26
        }
27
}
28
void main ()
29
{
30
  int j,i;
31
 
32
  for (i = 3; i < MA; i++)
33
    for (j = 3; j < MB; j++)
34
      T[i][j] = (i>j?i:j);
35
 
36
  MRTRBR (MA,NA,MB);
37
 
38
  for (i = MA-1; i < MA; i++)
39
    for (j = MB-10; j < MB; j++)
40
      printf ("i %d j %d T[i][j] = %d\n",i,j,T[i][j]);
41
}
42
 
43
 
44
/* Check that the outer most loop doesn't get parallelized (thus no loop gets parallelized)  */
45
 
46
/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
47
/* { dg-final { scan-tree-dump-times "loopfn" 0 "optimized" } } */
48
/* { dg-final { cleanup-tree-dump "parloops" } } */
49
/* { 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.