From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2066) id 59A2E383D005; Wed, 2 Jun 2021 07:57:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59A2E383D005 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jiu Fu Guo To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/guojiufu/heads/guojiufu-branch)] code clean up X-Act-Checkin: gcc X-Git-Author: Jiufu Guo X-Git-Refname: refs/users/guojiufu/heads/guojiufu-branch X-Git-Oldrev: 79af8adcfe8f4110505c86f6d0b13f38d744e101 X-Git-Newrev: af5f15731f42db52208e78de2fdb1c3699a1bdb0 Message-Id: <20210602075756.59A2E383D005@sourceware.org> Date: Wed, 2 Jun 2021 07:57:56 +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: Wed, 02 Jun 2021 07:57:56 -0000 https://gcc.gnu.org/g:af5f15731f42db52208e78de2fdb1c3699a1bdb0 commit af5f15731f42db52208e78de2fdb1c3699a1bdb0 Author: Jiufu Guo Date: Wed Jun 2 13:52:25 2021 +0800 code clean up Diff: --- gcc/tree-ssa-loop-split.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/gcc/tree-ssa-loop-split.c b/gcc/tree-ssa-loop-split.c index 926966a2bbc..791508e4f03 100644 --- a/gcc/tree-ssa-loop-split.c +++ b/gcc/tree-ssa-loop-split.c @@ -1675,31 +1675,23 @@ get_ne_cond_branch (struct loop *loop) if (!gsi_end_p (psi)) continue; - /* Get the idx from last stmt (the gcond) of bb. */ - gimple *gc = last_stmt (bb); - gcc_assert (gimple_code (gc) == GIMPLE_COND); - tree idx = gimple_cond_lhs (gc); - if (expr_invariant_in_loop_p (loop, idx)) - idx = gimple_cond_rhs (gc); - + /* Check it is ++i or ++i */ tree next = PHI_ARG_DEF_FROM_EDGE (phi, loop_latch_edge (loop)); tree prev = PHI_RESULT (phi); if (idx != prev && idx != next) continue; - /* ++i or ++i */ gimple_stmt_iterator gsi = gsi_start_nondebug_after_labels_bb (bb); if (gsi_end_p (gsi)) continue; - gimple *s1 = gsi_stmt (gsi); if (!is_gimple_assign (s1) || gimple_assign_lhs (s1) != next || gimple_assign_rhs1 (s1) != prev) continue; gsi_next (&gsi); - if (!gsi_end_p (gsi) && gsi_stmt (gsi) == gc) + if (!gsi_end_p (gsi) && gsi_stmt (gsi) == cond) return e; } } @@ -1741,7 +1733,7 @@ split_ne_loop (struct loop *loop, edge cond_e) gcond *break_cond = as_a (gimple_copy (gc)); edge pred_e = single_pred_edge (loop->latch); bool simple_loop = pred_e && pred_e->src == cond_e->src - && (gsi_end_p (gsi_start_nondebug_bb (loop->latch))); + && empty_block_p (loop->latch); if (simple_loop) gimple_cond_set_code (break_cond, down_code); else