From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 8732A3857433; Mon, 13 Sep 2021 15:31:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8732A3857433 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/loop-unswitching-switch-v3)] Fix statement updating. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/loop-unswitching-switch-v3 X-Git-Oldrev: e3e992c0fa9296002e9b53d5e156171354b9312e X-Git-Newrev: 1befd7e2e6d15192583b9f655ca88e53337a6fc0 Message-Id: <20210913153112.8732A3857433@sourceware.org> Date: Mon, 13 Sep 2021 15:31:12 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 15:31:12 -0000 https://gcc.gnu.org/g:1befd7e2e6d15192583b9f655ca88e53337a6fc0 commit 1befd7e2e6d15192583b9f655ca88e53337a6fc0 Author: Martin Liska Date: Mon Sep 13 17:22:26 2021 +0200 Fix statement updating. Diff: --- gcc/tree-ssa-loop-unswitch.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c index 0568c283c41..de8df78ca69 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -397,6 +397,7 @@ tree_unswitch_single_loop (class loop *loop, int num) { gimple_cond_set_condition_from_tree (condition, boolean_false_node); + update_stmt (condition); changed = true; } else if(ranger.range_on_edge (r, edge_false, gimple_cond_lhs (stmt)) @@ -404,6 +405,7 @@ tree_unswitch_single_loop (class loop *loop, int num) { gimple_cond_set_condition_from_tree (condition, boolean_true_node); + update_stmt (condition); changed = true; } } @@ -433,14 +435,14 @@ tree_unswitch_single_loop (class loop *loop, int num) if (index_candidate != NULL_TREE && ignored_edges.elements () == EDGE_COUNT (bbs[i]->succs) - 1) - gimple_switch_set_index (swtch, index_candidate); + { + gimple_switch_set_index (swtch, index_candidate); + update_stmt (swtch); + } } - /* gswitch can return NULL_TREE for cases that are not supported. */ - if (cond == NULL_TREE) - ; /* Do not unswitch too much. */ - else if (num > param_max_unswitch_level) + if (num > param_max_unswitch_level) { i++; continue; @@ -461,7 +463,6 @@ tree_unswitch_single_loop (class loop *loop, int num) break; } - update_stmt (stmt); i++; }