PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / prefetch-7.c
blobc9f70271892e47ae4ee9f09f88dcde3d47231ef0
1 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
2 /* { dg-options "-O2 -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
4 #define K 1000000
5 int a[K];
7 void test(int *p)
9 unsigned i;
11 /* Nontemporal store should not be used here (only write and read temporal
12 prefetches). */
13 for (i = 0; i < K - 10000; i++)
14 a[i + 10000] = a[i];
16 /* Nontemporal store should not be used here (only write and read nontemporal
17 prefetches). */
18 for (i = 0; i < K - 100000; i++)
19 a[i + 100000] = a[i];
21 /* Nontemporal store should be used neither for a nor for p, as we do not know
22 whether they alias or not. */
23 for (i = 0; i < K; i++)
25 a[i] = 0;
26 *p++ = 1;
29 /* Nontemporal store should not be used for a, as we do not know whether its
30 value will be reused or not. */
31 for (i = 0; i < 1000; i++)
32 a[i] = 0;
35 /* { dg-final { scan-tree-dump-times "Issued prefetch" 5 "aprefetch" } } */
36 /* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 2 "aprefetch" } } */
37 /* { dg-final { scan-tree-dump-times "a nontemporal store" 0 "aprefetch" } } */
39 /* { dg-final { scan-tree-dump-times "builtin_prefetch" 7 "optimized" } } */