Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/autopar/pr49960.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
5 #define MB 100 | 5 #define MB 100 |
6 #define NA 450 | 6 #define NA 450 |
7 #define MA 400 | 7 #define MA 400 |
8 | 8 |
9 int T[MA][MB],A[MA][NA],B[MB][NA]; | 9 int T[MA][MB],A[MA][NA],B[MB][NA]; |
10 void MRTRBR(int MA_1, int NA_1, int MB_1) | 10 void __attribute__((noinline)) |
11 MRTRBR(int MA_1, int NA_1, int MB_1) | |
11 { | 12 { |
12 int i,j, t,k; | 13 int i,j, t,k; |
13 | 14 |
14 /* At the moment we are not able to hoist the loop headers out of the loop | 15 /* At the moment we are not able to hoist the loop headers out of the loop |
15 nest. | 16 nest. |
19 return; | 20 return; |
20 | 21 |
21 /* The outer most loop is not parallel because for different k's there | 22 /* The outer most loop is not parallel because for different k's there |
22 is write-write dependency for T[i][j]. */ | 23 is write-write dependency for T[i][j]. */ |
23 | 24 |
24 /* The two inner loops don't get parallelized due to low number of | 25 /* The innermost loop doesn't get parallelized due to low number of |
25 iterations. */ | 26 iterations. */ |
26 | 27 |
27 for (k = 3; k < NA_1; k++) | 28 for (k = 3; k < NA_1; k++) |
28 for (i = 3; i < MA_1; i++) | 29 for (i = 3; i < MA_1; i++) |
29 for (j = 3; j < MB_1; j++) | 30 for (j = 3; j < MB_1; j++) |
36 { | 37 { |
37 int j,i; | 38 int j,i; |
38 | 39 |
39 for (i = 3; i < MA; i++) | 40 for (i = 3; i < MA; i++) |
40 for (j = 3; j < MB; j++) | 41 for (j = 3; j < MB; j++) |
41 T[i][j] = (i>j?i:j); | 42 { |
43 __asm__ volatile ("" : : : "memory"); | |
44 T[i][j] = (i>j?i:j); | |
45 } | |
42 | 46 |
43 MRTRBR (MA,NA,MB); | 47 MRTRBR (MA,NA,MB); |
44 | 48 |
45 for (i = MA-1; i < MA; i++) | 49 for (i = MA-1; i < MA; i++) |
46 for (j = MB-10; j < MB; j++) | 50 for (j = MB-10; j < MB; j++) |
47 printf ("i %d j %d T[i][j] = %d\n",i,j,T[i][j]); | 51 printf ("i %d j %d T[i][j] = %d\n",i,j,T[i][j]); |
48 } | 52 } |
49 | 53 |
50 | 54 |
51 /* Check that the outer most loop doesn't get parallelized (thus no loop gets parallelized) */ | 55 /* Check that the outer most loop doesn't get parallelized. */ |
52 | 56 |
53 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops2" } } */ | 57 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops2" } } */ |
54 /* { dg-final { scan-tree-dump-times "loopfn" 0 "optimized" } } */ | 58 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel" 1 "optimized" } } */ |