annotate gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
kono
parents:
diff changeset
2 /* { dg-options "-O2 -fprefetch-loop-arrays -march=amdfam10 --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 #define K 1000000
kono
parents:
diff changeset
5 int a[K];
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 void test(int *p)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 unsigned i;
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 /* Nontemporal store should not be used here (only write and read temporal
kono
parents:
diff changeset
12 prefetches). */
kono
parents:
diff changeset
13 for (i = 0; i < K - 10000; i++)
kono
parents:
diff changeset
14 a[i + 10000] = a[i];
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 /* Nontemporal store should not be used here (only write and read nontemporal
kono
parents:
diff changeset
17 prefetches). */
kono
parents:
diff changeset
18 for (i = 0; i < K - 100000; i++)
kono
parents:
diff changeset
19 a[i + 100000] = a[i];
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 /* Nontemporal store should be used neither for a nor for p, as we do not know
kono
parents:
diff changeset
22 whether they alias or not. */
kono
parents:
diff changeset
23 for (i = 0; i < K; i++)
kono
parents:
diff changeset
24 {
kono
parents:
diff changeset
25 a[i] = 0;
kono
parents:
diff changeset
26 *p++ = 1;
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 /* Nontemporal store should not be used for a, as we do not know whether its
kono
parents:
diff changeset
30 value will be reused or not. */
kono
parents:
diff changeset
31 for (i = 0; i < 1000; i++)
kono
parents:
diff changeset
32 a[i] = 0;
kono
parents:
diff changeset
33 }
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 /* { dg-final { scan-tree-dump-times "Issued prefetch" 5 "aprefetch" } } */
kono
parents:
diff changeset
36 /* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 2 "aprefetch" } } */
kono
parents:
diff changeset
37 /* { dg-final { scan-tree-dump-times "a nontemporal store" 0 "aprefetch" } } */
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 /* { dg-final { scan-tree-dump-times "builtin_prefetch" 7 "optimized" } } */