diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-10-17 12:54:54 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-10-17 12:54:54 +0200 |
commit | 73049af5fa62c7eeca27585f8f318e9bea7c47ae (patch) | |
tree | 3d9f1e754cc0f6442d99387021c379a081f76de3 /gcc/tree-switch-conversion.c | |
parent | 4eb4a256cd4a39555f4d834c47cabc2e136ed02a (diff) | |
download | gcc-73049af5fa62c7eeca27585f8f318e9bea7c47ae.zip gcc-73049af5fa62c7eeca27585f8f318e9bea7c47ae.tar.gz gcc-73049af5fa62c7eeca27585f8f318e9bea7c47ae.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r-- | gcc/tree-switch-conversion.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index ae5853b..f205129 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -125,35 +125,6 @@ hoist_edge_and_branch_if_true (gimple_stmt_iterator *gsip, } -/* Determine whether "1 << x" is relatively cheap in word_mode. */ -/* FIXME: This is the function that we need rtl.h and optabs.h for. - This function (and similar RTL-related cost code in e.g. IVOPTS) should - be moved to some kind of interface file for GIMPLE/RTL interactions. */ -static bool -lshift_cheap_p (bool speed_p) -{ - /* FIXME: This should be made target dependent via this "this_target" - mechanism, similar to e.g. can_copy_init_p in gcse.c. */ - static bool init[2] = {false, false}; - static bool cheap[2] = {true, true}; - - /* If the targer has no lshift in word_mode, the operation will most - probably not be cheap. ??? Does GCC even work for such targets? */ - if (optab_handler (ashl_optab, word_mode) == CODE_FOR_nothing) - return false; - - if (!init[speed_p]) - { - rtx reg = gen_raw_REG (word_mode, 10000); - int cost = set_src_cost (gen_rtx_ASHIFT (word_mode, const1_rtx, reg), - speed_p); - cheap[speed_p] = cost < COSTS_N_INSNS (MAX_CASE_BIT_TESTS); - init[speed_p] = true; - } - - return cheap[speed_p]; -} - /* Return true if a switch should be expanded as a bit test. RANGE is the difference between highest and lowest case. UNIQ is number of unique case node targets, not counting the default case. |