From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2066) id 389A63988038; Wed, 9 Jun 2021 04:55:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 389A63988038 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/personal-branch)] make sure prev is the phi, and next is for the same phi X-Act-Checkin: gcc X-Git-Author: Jiufu Guo X-Git-Refname: refs/users/guojiufu/heads/personal-branch X-Git-Oldrev: 248e89b0aab67d7a473a8ee4c87e2f0fc8cade75 X-Git-Newrev: c05852b0ee2c946dc06555c6c5649d5de661dfab Message-Id: <20210609045538.389A63988038@sourceware.org> Date: Wed, 9 Jun 2021 04:55:37 +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, 09 Jun 2021 04:55:38 -0000 https://gcc.gnu.org/g:c05852b0ee2c946dc06555c6c5649d5de661dfab commit c05852b0ee2c946dc06555c6c5649d5de661dfab Author: Jiufu Guo Date: Wed Jun 9 12:54:52 2021 +0800 make sure prev is the phi, and next is for the same phi Diff: --- gcc/tree-ssa-loop-split.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/tree-ssa-loop-split.c b/gcc/tree-ssa-loop-split.c index 3d9cd2e4cc3..e01d44a6b28 100644 --- a/gcc/tree-ssa-loop-split.c +++ b/gcc/tree-ssa-loop-split.c @@ -1730,6 +1730,12 @@ analyze_idx_elements (class loop *loop, edge e, idx_elements &data) if (TREE_CODE (gimple_assign_rhs2 (stmt)) != INTEGER_CST) return false; inc_stmt = stmt; + tree prev = gimple_assign_rhs1 (stmt); + if (TREE_CODE (prev) != SSA_NAME) + return false; + stmt = filter_conversions (loop, prev, &small_type, &large_type); + if (stmt != phi) + return false; data.gc = gc; data.phi = phi; @@ -1921,12 +1927,11 @@ split_wrap_boundary (class loop *loop, edge e, tree no_wrap_cond) /* Version the loop. */ initialize_original_copy_tables (); basic_block cond_bb; - class loop *loop1 - = loop_version (loop, no_wrap_cond, &cond_bb, - profile_probability::very_likely (), - profile_probability::very_unlikely (), - profile_probability::very_likely (), - profile_probability::very_unlikely (), true); + loop_version (loop, no_wrap_cond, &cond_bb, + profile_probability::very_likely (), + profile_probability::very_unlikely (), + profile_probability::very_likely (), + profile_probability::very_unlikely (), true); free_original_copy_tables (); /* Insert the statements that feed COND. */