diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-17 14:50:13 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-17 14:50:13 +0000 |
commit | 2ebfc881dcb0e21ed61983433f570df9118325a4 (patch) | |
tree | d096ec551125ec07018795cb4a794091435c90a9 /gcc/tree-cfgcleanup.c | |
parent | a6e7114223dac3eb9a70fedb120c83d79deca89b (diff) | |
download | gcc-2ebfc881dcb0e21ed61983433f570df9118325a4.tar.gz |
* tree-cfgcleanup. (cleanup_control_expr_graph) <GIMPLE_COND>: Remove
code doing propagation from degenerate PHI nodes.
* tree-ssa-loop-ivcanon.c (propagate_into_all_uses): New function.
(propagate_constants_for_unrolling): Likewise.
(tree_unroll_loops_completely): If the current loop has been unrolled
and its father isn't the entire function, propagate constants within
the new basic blocks by means of propagate_constants_for_unrolling.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191387 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 45f33682e30..9c522861401 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -88,40 +88,11 @@ cleanup_control_expr_graph (basic_block bb, gimple_stmt_iterator gsi) switch (gimple_code (stmt)) { case GIMPLE_COND: - { - tree lhs = gimple_cond_lhs (stmt); - tree rhs = gimple_cond_rhs (stmt); - /* For conditions try harder and lookup single-argument - PHI nodes. Only do so from the same basic-block though - as other basic-blocks may be dead already. */ - if (TREE_CODE (lhs) == SSA_NAME - && !name_registered_for_update_p (lhs)) - { - gimple def_stmt = SSA_NAME_DEF_STMT (lhs); - if (gimple_code (def_stmt) == GIMPLE_PHI - && gimple_phi_num_args (def_stmt) == 1 - && gimple_bb (def_stmt) == gimple_bb (stmt) - && (TREE_CODE (PHI_ARG_DEF (def_stmt, 0)) != SSA_NAME - || !name_registered_for_update_p (PHI_ARG_DEF (def_stmt, - 0)))) - lhs = PHI_ARG_DEF (def_stmt, 0); - } - if (TREE_CODE (rhs) == SSA_NAME - && !name_registered_for_update_p (rhs)) - { - gimple def_stmt = SSA_NAME_DEF_STMT (rhs); - if (gimple_code (def_stmt) == GIMPLE_PHI - && gimple_phi_num_args (def_stmt) == 1 - && gimple_bb (def_stmt) == gimple_bb (stmt) - && (TREE_CODE (PHI_ARG_DEF (def_stmt, 0)) != SSA_NAME - || !name_registered_for_update_p (PHI_ARG_DEF (def_stmt, - 0)))) - rhs = PHI_ARG_DEF (def_stmt, 0); - } - val = fold_binary_loc (loc, gimple_cond_code (stmt), - boolean_type_node, lhs, rhs); - break; - } + val = fold_binary_loc (loc, gimple_cond_code (stmt), + boolean_type_node, + gimple_cond_lhs (stmt), + gimple_cond_rhs (stmt)); + break; case GIMPLE_SWITCH: val = gimple_switch_index (stmt); |