1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops2-details -fdump-tree-optimized -fno-partial-inlining" } */
9 int T
[MA
][MB
],A
[MA
][NA
],B
[MB
][NA
];
10 void __attribute__((noinline
))
11 MRTRBR(int MA_1
, int NA_1
, int MB_1
)
15 /* At the moment we are not able to hoist the loop headers out of the loop
17 Partial inlining needs to be disabled so we do not optimize this out
18 of the function body. */
19 if (MA_1
< 4 || NA_1
< 4 || MB_1
< 4)
22 /* The outer most loop is not parallel because for different k's there
23 is write-write dependency for T[i][j]. */
25 /* The innermost loop doesn't get parallelized due to low number of
28 for (k
= 3; k
< NA_1
; k
++)
29 for (i
= 3; i
< MA_1
; i
++)
30 for (j
= 3; j
< MB_1
; j
++)
33 T
[i
][j
] = t
+2+A
[i
][k
]*B
[j
][k
];
40 for (i
= 3; i
< MA
; i
++)
41 for (j
= 3; j
< MB
; j
++)
43 __asm__
volatile ("" : : : "memory");
49 for (i
= MA
-1; i
< MA
; i
++)
50 for (j
= MB
-10; j
< MB
; j
++)
51 printf ("i %d j %d T[i][j] = %d\n",i
,j
,T
[i
][j
]);
55 /* Check that the outer most loop doesn't get parallelized. */
57 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops2" } } */
58 /* { dg-final { scan-tree-dump-times "__builtin_GOMP_parallel" 1 "optimized" } } */