From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id E50B7385800E; Wed, 8 Dec 2021 18:26:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E50B7385800E 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-unswitch-improvement-v7)] Support only loops with SSA_NAMEs and CONSTANTS. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/loop-unswitch-improvement-v7 X-Git-Oldrev: 75af8a0a913e0835242ff5165be8a1f5183e1e97 X-Git-Newrev: 62f971c68492af83155787a6215698d0da88c756 Message-Id: <20211208182647.E50B7385800E@sourceware.org> Date: Wed, 8 Dec 2021 18:26:47 +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, 08 Dec 2021 18:26:48 -0000 https://gcc.gnu.org/g:62f971c68492af83155787a6215698d0da88c756 commit 62f971c68492af83155787a6215698d0da88c756 Author: Martin Liska Date: Wed Dec 8 11:15:56 2021 +0100 Support only loops with SSA_NAMEs and CONSTANTS. Diff: --- gcc/tree-ssa-loop-unswitch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c index 6e25eb703fe..cb4be6d52e2 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -370,6 +370,10 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop, tree lhs = gimple_cond_lhs (stmt); tree rhs = gimple_cond_rhs (stmt); + if (TREE_CODE (lhs) != SSA_NAME + || !TREE_CONSTANT (rhs)) + return; + cond = build2 (gimple_cond_code (stmt), boolean_type_node, lhs, rhs); edge edge_true, edge_false; extract_true_false_edges_from_block (bb, &edge_true, &edge_false);