+2010-06-10 Changpeng Fang <changpeng.fang@amd.com>
+
+ PR middle-end/44185
+ * gcc.dg/tree-ssa/prefetch-7.c: take the loops that will generate
+ non-temporal stores out of the tests to form new test cases. As a
+ result, no non-temporal store should be generated in this case.
+
+ * gcc.dg/tree-ssa/prefetch-8.c: New. Test from original
+ prefetch-7.c that generate one non-temporal store.
+
+ * gcc.dg/tree-ssa/prefetch-9.c: New. Test from original
+ prefetch-7.c that generate one non-temporal store and one
+ one-temporal prefetch.
+
2010-06-10 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/44258
/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
#define K 1000000
-int a[K], b[K];
+int a[K];
void test(int *p)
{
unsigned i;
- /* Nontemporal store should be used for a. */
- for (i = 0; i < K; i++)
- a[i] = 0;
-
- /* Nontemporal store should be used for a, nontemporal prefetch for b. */
- for (i = 0; i < K; i++)
- a[i] = b[i];
-
/* Nontemporal store should not be used here (only write and read temporal
prefetches). */
for (i = 0; i < K - 10000; i++)
}
/* { dg-final { scan-tree-dump-times "Issued prefetch" 5 "aprefetch" } } */
-/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 3 "aprefetch" } } */
-/* { dg-final { scan-tree-dump-times "a nontemporal store" 2 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 2 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "a nontemporal store" 0 "aprefetch" } } */
-/* { dg-final { scan-tree-dump-times "builtin_prefetch" 8 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "=\\{nt\\}" 18 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "builtin_prefetch" 7 "optimized" } } */
/* { dg-final { scan-assembler-times "prefetchw" 5 } } */
/* { dg-final { scan-assembler-times "prefetcht" 1 } } */
-/* { dg-final { scan-assembler-times "prefetchnta" 2 } } */
-/* { dg-final { scan-assembler-times "movnti" 18 } } */
-/* { dg-final { scan-assembler-times "mfence" 2 } } */
+/* { dg-final { scan-assembler-times "prefetchnta" 1 } } */
/* { dg-final { cleanup-tree-dump "aprefetch" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
--- /dev/null
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+
+#define K 1000000
+int a[K];
+
+void test()
+{
+ unsigned i;
+
+ /* Nontemporal store should be used for a. */
+ for (i = 0; i < K; i++)
+ a[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "a nontemporal store" 1 "aprefetch" } } */
+
+/* { dg-final { scan-tree-dump "=\\{nt\\}" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 1 "optimized" } } */
+
+/* { dg-final { scan-assembler "movnti" } } */
+/* { dg-final { scan-assembler-times "mfence" 1 } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
--- /dev/null
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+
+#define K 1000000
+int a[K], b[K];
+
+void test()
+{
+ unsigned i;
+
+ /* Nontemporal store should be used for a, nontemporal prefetch for b. */
+ for (i = 0; i < K; i++)
+ a[i] = b[i];
+
+}
+
+/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 1 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "a nontemporal store" 1 "aprefetch" } } */
+
+/* { dg-final { scan-tree-dump-times "builtin_prefetch" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump "=\\{nt\\}" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 1 "optimized" } } */
+
+/* { dg-final { scan-assembler-times "prefetchnta" 1 } } */
+/* { dg-final { scan-assembler "movnti" } } */
+/* { dg-final { scan-assembler-times "mfence" 1 } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */