From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 354973858434; Wed, 8 Dec 2021 10:18:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 354973858434 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: ea706f21a4839306c48b0ebf242d93d103e5a503 X-Git-Newrev: 6847fdc2205834b58409e82912cbba5c48ccd5ac Message-Id: <20211208101806.354973858434@sourceware.org> Date: Wed, 8 Dec 2021 10:18:06 +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 10:18:06 -0000 https://gcc.gnu.org/g:6847fdc2205834b58409e82912cbba5c48ccd5ac commit 6847fdc2205834b58409e82912cbba5c48ccd5ac 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 f39f0e3311e..2b72e562bc7 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -369,6 +369,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);