diff options
author | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:52:19 +0000 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:52:19 +0000 |
commit | 7e05bab54f745defb749670b8c84eaf513c0b214 (patch) | |
tree | 49524df297e69390449c3ef5037b2360d14c7b1a /gcc/tree-ssa-reassoc.c | |
parent | 77b800ca8b1cca32db99261ade36bf5f0eafaff8 (diff) |
Merged trunk revision 250739 into the hsa branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/hsa@250744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 35eb72ce310..7c3007f853a 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -2561,7 +2561,7 @@ optimize_range_tests_diff (enum tree_code opcode, tree type, tem2 = fold_convert (type, tem2); lowi = fold_convert (type, lowi); mask = fold_build1 (BIT_NOT_EXPR, type, tem1); - tem1 = fold_binary (MINUS_EXPR, type, + tem1 = fold_build2 (MINUS_EXPR, type, fold_convert (type, rangei->exp), lowi); tem1 = fold_build2 (BIT_AND_EXPR, type, tem1, mask); lowj = build_int_cst (type, 0); @@ -4205,11 +4205,15 @@ insert_stmt_before_use (gimple *stmt, gimple *stmt_to_insert) /* Recursively rewrite our linearized statements so that the operators match those in OPS[OPINDEX], putting the computation in rank - order. Return new lhs. */ + order. Return new lhs. + CHANGED is true if we shouldn't reuse the lhs SSA_NAME both in + the current stmt and during recursive invocations. + NEXT_CHANGED is true if we shouldn't reuse the lhs SSA_NAME in + recursive invocations. */ static tree rewrite_expr_tree (gimple *stmt, unsigned int opindex, - vec<operand_entry *> ops, bool changed) + vec<operand_entry *> ops, bool changed, bool next_changed) { tree rhs1 = gimple_assign_rhs1 (stmt); tree rhs2 = gimple_assign_rhs2 (stmt); @@ -4300,7 +4304,8 @@ rewrite_expr_tree (gimple *stmt, unsigned int opindex, be the non-leaf side. */ tree new_rhs1 = rewrite_expr_tree (SSA_NAME_DEF_STMT (rhs1), opindex + 1, ops, - changed || oe->op != rhs2); + changed || oe->op != rhs2 || next_changed, + false); if (oe->op != rhs2 || new_rhs1 != rhs1) { @@ -5654,6 +5659,7 @@ reassociate_bb (basic_block bb) gimple_set_visited (stmt, true); linearize_expr_tree (&ops, stmt, true, true); ops.qsort (sort_by_operand_rank); + int orig_len = ops.length (); optimize_ops_list (rhs_code, &ops); if (undistribute_ops_list (rhs_code, &ops, loop_containing_stmt (stmt))) @@ -5744,7 +5750,8 @@ reassociate_bb (basic_block bb) new_lhs = rewrite_expr_tree (stmt, 0, ops, powi_result != NULL - || negate_result); + || negate_result, + len != orig_len); } /* If we combined some repeated factors into a @@ -5843,7 +5850,7 @@ branch_fixup (void) gsi_insert_after (&gsi, g, GSI_NEW_STMT); edge etrue = make_edge (cond_bb, merge_bb, EDGE_TRUE_VALUE); - etrue->probability = REG_BR_PROB_BASE / 2; + etrue->probability = profile_probability::even (); etrue->count = cond_bb->count.apply_scale (1, 2); edge efalse = find_edge (cond_bb, then_bb); efalse->flags = EDGE_FALSE_VALUE; |