aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2015-01-06 11:51:16 +0000
committerThomas Preud'homme <thopre01@gcc.gnu.org>2015-01-06 11:51:16 +0000
commite4a5735015888eaea5ec6964a3d879a1e61ea75a (patch)
tree2d75dee25b815b763b4547ef9bd964c6dffd3b22 /gcc
parent02169d7807750eba35013a832975df24bf309384 (diff)
downloadgcc-e4a5735015888eaea5ec6964a3d879a1e61ea75a.zip
gcc-e4a5735015888eaea5ec6964a3d879a1e61ea75a.tar.gz
gcc-e4a5735015888eaea5ec6964a3d879a1e61ea75a.tar.bz2
re PR tree-optimization/63259 (Detecting byteswap sequence)
2015-01-06 Thomas Preud'homme <thomas.preudhomme@arm.com> gcc/ PR tree-optimization/63259 * tree-ssa-math-opts.c (pass_optimize_bswap::execute): Stop checking if optab exists for 16bit byteswap. From-SVN: r219256
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-math-opts.c19
2 files changed, 9 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index daae241..4b3d6ca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-06 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR tree-optimization/63259
+ * tree-ssa-math-opts.c (pass_optimize_bswap::execute): Stop checking
+ if optab exists for 16bit byteswap.
+
2015-01-06 Jakub Jelinek <jakub@redhat.com>
* opts.c (common_handle_option): Add support for
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index d9476b821..68da85a 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2350,15 +2350,13 @@ unsigned int
pass_optimize_bswap::execute (function *fun)
{
basic_block bb;
- bool bswap16_p, bswap32_p, bswap64_p;
+ bool bswap32_p, bswap64_p;
bool changed = false;
- tree bswap16_type = NULL_TREE, bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
+ tree bswap32_type = NULL_TREE, bswap64_type = NULL_TREE;
if (BITS_PER_UNIT != 8)
return 0;
- bswap16_p = (builtin_decl_explicit_p (BUILT_IN_BSWAP16)
- && optab_handler (bswap_optab, HImode) != CODE_FOR_nothing);
bswap32_p = (builtin_decl_explicit_p (BUILT_IN_BSWAP32)
&& optab_handler (bswap_optab, SImode) != CODE_FOR_nothing);
bswap64_p = (builtin_decl_explicit_p (BUILT_IN_BSWAP64)
@@ -2367,12 +2365,6 @@ pass_optimize_bswap::execute (function *fun)
/* Determine the argument type of the builtins. The code later on
assumes that the return and argument type are the same. */
- if (bswap16_p)
- {
- tree fndecl = builtin_decl_explicit (BUILT_IN_BSWAP16);
- bswap16_type = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
- }
-
if (bswap32_p)
{
tree fndecl = builtin_decl_explicit (BUILT_IN_BSWAP32);
@@ -2443,11 +2435,6 @@ pass_optimize_bswap::execute (function *fun)
if (code == LROTATE_EXPR || code == RROTATE_EXPR)
continue;
load_type = uint16_type_node;
- if (bswap16_p)
- {
- fndecl = builtin_decl_explicit (BUILT_IN_BSWAP16);
- bswap_type = bswap16_type;
- }
break;
case 32:
load_type = uint32_type_node;
@@ -2469,7 +2456,7 @@ pass_optimize_bswap::execute (function *fun)
continue;
}
- if (bswap && !fndecl)
+ if (bswap && !fndecl && n.range != 16)
continue;
if (bswap_replace (cur_stmt, src_stmt, fndecl, bswap_type, load_type,