re PR tree-optimization/63464 (compare one character to many: faster)
authorJakub Jelinek <jakub@redhat.com>
Fri, 17 Oct 2014 10:54:54 +0000 (12:54 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 17 Oct 2014 10:54:54 +0000 (12:54 +0200)
commit73049af5fa62c7eeca27585f8f318e9bea7c47ae
tree3d9f1e754cc0f6442d99387021c379a081f76de3
parent4eb4a256cd4a39555f4d834c47cabc2e136ed02a
re PR tree-optimization/63464 (compare one character to many: faster)

PR tree-optimization/63464
* gimple.h (gimple_seq_discard): New prototype.
* gimple.c: Include stringpool.h and tree-ssanames.h.
(gimple_seq_discard): New function.
* optabs.h (lshift_cheap_p): New prototype.
* optabs.c (lshift_cheap_p): New function, moved from...
* tree-switch-conversion.c (lshift_cheap_p): ... here.
* tree-ssa-reassoc.c: Include gimplify.h and optabs.h.
(reassoc_branch_fixups): New variable.
(update_range_test): Add otherrangep and seq arguments.
Unshare exp.  If otherrange is NULL, use for other ranges
array of pointers pointed by otherrangep instead.
Emit seq before gimplified statements for tem.
(optimize_range_tests_diff): Adjust update_range_test
caller.
(optimize_range_tests_xor): Likewise.  Fix up comment.
(extract_bit_test_mask, optimize_range_tests_to_bit_test): New
functions.
(optimize_range_tests): Adjust update_range_test caller.
Call optimize_range_tests_to_bit_test.
(branch_fixup): New function.
(execute_reassoc): Call branch_fixup.

* gcc.dg/torture/pr63464.c: New test.
* gcc.dg/tree-ssa/reassoc-37.c: New test.
* gcc.dg/tree-ssa/reassoc-38.c: New test.

From-SVN: r216393
gcc/ChangeLog
gcc/gimple.c
gcc/gimple.h
gcc/optabs.c
gcc/optabs.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr63464.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/reassoc-37.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/reassoc-38.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c
gcc/tree-switch-conversion.c