diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2016-11-16 18:10:34 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2016-11-16 18:10:34 +0000 |
commit | dd784916f5a7bd522e8b27f274a3e9a6d14d892f (patch) | |
tree | 95cdedbc8770628bd05cade2f2c9927771d2d8e2 /gcc | |
parent | 0af30954688a9dc1fccdc7579807cb1f46b6ebd6 (diff) | |
download | gcc-dd784916f5a7bd522e8b27f274a3e9a6d14d892f.zip gcc-dd784916f5a7bd522e8b27f274a3e9a6d14d892f.tar.gz gcc-dd784916f5a7bd522e8b27f274a3e9a6d14d892f.tar.bz2 |
Looking at PR77308, one of the issues is that the bswap optimization phase doesn't work on ARM.
Looking at PR77308, one of the issues is that the bswap optimization
phase doesn't work on ARM. This is due to an odd check that uses
SLOW_UNALIGNED_ACCESS (which is always true on ARM). Since the testcase
in PR77308 generates much better code with this patch (~13% fewer
instructions), it seems best to remove this check.
gcc/
* tree-ssa-math-opts.c (bswap_replace): Remove test
of SLOW_UNALIGNED_ACCESS.
testsuite/
* gcc.dg/optimize-bswapdi-3.c: Remove xfail.
* gcc.dg/optimize-bswaphi-1.c: Likewise.
* gcc.dg/optimize-bswapsi-2.c: Likewise.
From-SVN: r242506
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/optimize-bswapdi-3.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/optimize-bswaphi-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/optimize-bswapsi-2.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 5 |
6 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index be573a3..a5290ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-11-16 Wilco Dijkstra <wdijkstr@arm.com> + + * tree-ssa-math-opts.c (bswap_replace): Remove test + of SLOW_UNALIGNED_ACCESS. + 2016-11-16 Alexander Monakov <amonakov@ispras.ru> * config/nvptx/mkoffload.c (main): Check that either OpenACC or OpenMP diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d750f25d..3f8831e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2015-11-16 Wilco Dijkstra <wdijkstr@arm.com> + + * gcc.dg/optimize-bswapdi-3.c: Remove xfail. + * gcc.dg/optimize-bswaphi-1.c: Likewise. + * gcc.dg/optimize-bswapsi-2.c: Likewise. + 2016-11-16 Szabolcs Nagy <szabolcs.nagy@arm.com> PR libgfortran/78314 diff --git a/gcc/testsuite/gcc.dg/optimize-bswapdi-3.c b/gcc/testsuite/gcc.dg/optimize-bswapdi-3.c index 273b4bc..6f68201 100644 --- a/gcc/testsuite/gcc.dg/optimize-bswapdi-3.c +++ b/gcc/testsuite/gcc.dg/optimize-bswapdi-3.c @@ -61,4 +61,4 @@ uint64_t read_be64_3 (unsigned char *data) } /* { dg-final { scan-tree-dump-times "64 bit load in target endianness found at" 3 "bswap" } } */ -/* { dg-final { scan-tree-dump-times "64 bit bswap implementation found at" 3 "bswap" { xfail alpha*-*-* arm*-*-* } } } */ +/* { dg-final { scan-tree-dump-times "64 bit bswap implementation found at" 3 "bswap" } } */ diff --git a/gcc/testsuite/gcc.dg/optimize-bswaphi-1.c b/gcc/testsuite/gcc.dg/optimize-bswaphi-1.c index c18ca61..852ccfe 100644 --- a/gcc/testsuite/gcc.dg/optimize-bswaphi-1.c +++ b/gcc/testsuite/gcc.dg/optimize-bswaphi-1.c @@ -55,5 +55,4 @@ swap16 (HItype in) } /* { dg-final { scan-tree-dump-times "16 bit load in target endianness found at" 3 "bswap" } } */ -/* { dg-final { scan-tree-dump-times "16 bit bswap implementation found at" 1 "bswap" { target alpha*-*-* arm*-*-* } } } */ -/* { dg-final { scan-tree-dump-times "16 bit bswap implementation found at" 4 "bswap" { xfail alpha*-*-* arm*-*-* } } } */ +/* { dg-final { scan-tree-dump-times "16 bit bswap implementation found at" 4 "bswap" } } */ diff --git a/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c b/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c index a1558af..01ae377 100644 --- a/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c +++ b/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c @@ -45,4 +45,4 @@ uint32_t read_be32_3 (unsigned char *data) } /* { dg-final { scan-tree-dump-times "32 bit load in target endianness found at" 3 "bswap" } } */ -/* { dg-final { scan-tree-dump-times "32 bit bswap implementation found at" 3 "bswap" { xfail alpha*-*-* arm*-*-* } } } */ +/* { dg-final { scan-tree-dump-times "32 bit bswap implementation found at" 3 "bswap" } } */ diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index b28c808..a389dfc 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -2649,11 +2649,6 @@ bswap_replace (gimple *cur_stmt, gimple *src_stmt, tree fndecl, align = get_object_alignment (src); - if (bswap - && align < GET_MODE_ALIGNMENT (TYPE_MODE (load_type)) - && SLOW_UNALIGNED_ACCESS (TYPE_MODE (load_type), align)) - return false; - /* Move cur_stmt just before one of the load of the original to ensure it has the same VUSE. See PR61517 for what could go wrong. */ |