diff options
author | Martin Liska <mliska@suse.cz> | 2018-08-27 15:18:43 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-08-27 13:18:43 +0000 |
commit | 6b60ee204f80649803dc78c24ab9c94ff8f51789 (patch) | |
tree | d804b6faa6cf81b473df7b9357bdae1c64d28ac4 | |
parent | 3d78e00879b42574c9b0084c30f1361f0cfb9101 (diff) | |
download | gcc-6b60ee204f80649803dc78c24ab9c94ff8f51789.zip gcc-6b60ee204f80649803dc78c24ab9c94ff8f51789.tar.gz gcc-6b60ee204f80649803dc78c24ab9c94ff8f51789.tar.bz2 |
Add test for memcpy expansion with hint.
2018-08-27 Martin Liska <mliska@suse.cz>
* config/i386/i386.c (ix86_expand_set_or_movmem): Dump
selected expansion strategy.
2018-08-27 Martin Liska <mliska@suse.cz>
* gcc.dg/tree-prof/val-prof-10.c: New test.
From-SVN: r263881
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-10.c | 31 |
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 459bcad..6c79e41 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-08-27 Martin Liska <mliska@suse.cz> + * config/i386/i386.c (ix86_expand_set_or_movmem): Dump + selected expansion strategy. + +2018-08-27 Martin Liska <mliska@suse.cz> + * builtins.h (is_builtin_fn): Remove and fndecl_built_in_p. * builtins.c (is_builtin_fn): Likewise. * attribs.c (diag_attr_exclusions): Use new function diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index eab482c..c437c18 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -27530,6 +27530,11 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp, issetmem, issetmem && val_exp == const0_rtx, have_as, &dynamic_check, &noalign, false); + + if (dump_file) + fprintf (dump_file, "Selected stringop expansion strategy: %s\n", + stringop_alg_names[alg]); + if (alg == libcall) return false; gcc_assert (alg != no_stringop); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e74b17..6e6ffd8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2018-08-27 Martin Liska <mliska@suse.cz> + * gcc.dg/tree-prof/val-prof-10.c: New test. + +2018-08-27 Martin Liska <mliska@suse.cz> + PR tree-optimization/86847 * gcc.dg/tree-ssa/switch-3.c: New test. * gcc.dg/tree-ssa/vrp105.c: Remove. diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-10.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-10.c new file mode 100644 index 0000000..57854b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-10.c @@ -0,0 +1,31 @@ +/* { dg-options "-O2 -fdump-rtl-expand -mtune=core2" } */ +/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } } */ + +long buffer1[128], buffer2[128]; +char *x; + +void foo(long *r) +{ + x = (char *)r; + asm volatile("" ::: "memory"); +} + +void +__attribute__((noinline)) +compute() +{ + volatile int n = 24; + __builtin_memcpy (buffer1, buffer2, n); + foo (&buffer1[0]); +} + +int +main() +{ + for (unsigned i = 0; i < 10000; i++) + compute (); + + return 0; +} + +/* { dg-final-use-not-autofdo { scan-rtl-dump "Selected stringop expansion strategy: rep_byte" "expand" } } */ |