From d36405344205c58beb1947719345ec80fdc00a34 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 1 May 2019 11:33:32 -0600 Subject: re PR tree-optimization/88797 (Unneeded branch added when function is inlined (function runs faster if not inlined)) PR tree-optimization/88797 * gimple-ssa-split-paths (is_feasible_trace): Reject cases where the PHI feeds a conditional on the RHS of an assignment. PR tree-optimization/88797 * g++.dg/tree-ssa/pr88797.C: New test. From-SVN: r270775 --- gcc/gimple-ssa-split-paths.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/gimple-ssa-split-paths.c') diff --git a/gcc/gimple-ssa-split-paths.c b/gcc/gimple-ssa-split-paths.c index 33bbb66..5bf45ee 100644 --- a/gcc/gimple-ssa-split-paths.c +++ b/gcc/gimple-ssa-split-paths.c @@ -264,8 +264,12 @@ is_feasible_trace (basic_block bb) if (is_gimple_debug (stmt)) continue; /* If there's a use in the joiner this might be a CSE/DCE - opportunity. */ - if (gimple_bb (stmt) == bb) + opportunity, but not if the use is in a conditional + which makes this a likely if-conversion candidate. */ + if (gimple_bb (stmt) == bb + && (!is_gimple_assign (stmt) + || (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) + != tcc_comparison))) { found_useful_phi = true; break; -- cgit v1.1