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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ldist-2.c] - Blame information for rev 749

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-loop-distribution -fdump-tree-ldist-all" } */
3
 
4
void foo (int * __restrict__ a,
5
          int * __restrict__ b,
6
          int * __restrict__ c)
7
{
8
  int i;
9
 
10
  for (i=1; i < 10; i++)
11
    {
12
      a[i] += c[i];
13
      b[i] = a[i - 1] + 1;
14
    }
15
 
16
  /* This loop is not distributed because the cost of spliting it:
17
 
18
     |  for (i=1; i < N; i++)
19
     |    a[i] += c[i];
20
     |
21
     |  for (i=1; i < N; i++)
22
     |    b[i] = a[i - 1] + 1;
23
 
24
     is higher due to data in array A that is written and then read in
25
     another task.  The cost model should forbid the transformation in
26
     this case.
27
  */
28
}
29
 
30
/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
31
/* { dg-final { cleanup-tree-dump "ldist" } } */

powered by: WebSVN 2.1.0

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