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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [interchange-14.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target size32plus } */
2
 
3
#define DEBUG 0
4
#if DEBUG
5
#include <stdio.h>
6
#endif
7
 
8
#define N 200
9
 
10
int A[N][N], B[N][N], C[N][N];
11
 
12
static void __attribute__((noinline))
13
matmult (void)
14
{
15
  int i, j, k;
16
 
17
  for (i = 0; i < N; i++)
18
    for (j = 0; j < N; j++)
19
      A[i][j] = 0;
20
 
21
  /* Loops J and K should be interchanged.  */
22
  for (i = 0; i < N; i++)
23
    for (j = 0; j < N; j++)
24
      for (k = 0; k < N; k++)
25
        A[i][j] += B[i][k] * C[k][j];
26
}
27
 
28
extern void abort ();
29
 
30
int
31
main (void)
32
{
33
  int i, j, res = 0;
34
 
35
  for (i = 0; i < N; i++)
36
    for (j = 0; j < N; j++)
37
      {
38
        B[i][j] = j;
39
        C[i][j] = i;
40
      }
41
 
42
  matmult ();
43
 
44
  for (i = 0; i < N; i++)
45
    res += A[i][i];
46
 
47
#if DEBUG
48
  fprintf (stderr, "res = %d \n", res);
49
#endif
50
 
51
  if (res != 529340000)
52
    abort ();
53
 
54
  return 0;
55
}
56
 
57
/* PRE destroys the perfect nest and we can't cope with that yet.  */
58
/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
59
/* { dg-final { cleanup-tree-dump "graphite" } } */

powered by: WebSVN 2.1.0

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