aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadbackward.cc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2023-02-12 16:35:44 +0100
committerThomas Schwinge <thomas@codesourcery.com>2023-02-12 16:35:44 +0100
commitd4d6d573b4a232519992123ae35740b0e5fa03da (patch)
treee46611c950994b3dac5e088950b5b84f68a0744c /gcc/tree-ssa-threadbackward.cc
parent2c454254ce5e41ca86717127d53ab75f8b64126a (diff)
parenta31becca488b537cfc24bba7c0f48b2c44726240 (diff)
downloadgcc-d4d6d573b4a232519992123ae35740b0e5fa03da.zip
gcc-d4d6d573b4a232519992123ae35740b0e5fa03da.tar.gz
gcc-d4d6d573b4a232519992123ae35740b0e5fa03da.tar.bz2
Merge commit '83ffe9cde7fe0b4deb0d1b54175fd9b19c38179c^' into HEAD
Diffstat (limited to 'gcc/tree-ssa-threadbackward.cc')
-rw-r--r--gcc/tree-ssa-threadbackward.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc
index 8a64535..fcbb95b 100644
--- a/gcc/tree-ssa-threadbackward.cc
+++ b/gcc/tree-ssa-threadbackward.cc
@@ -868,22 +868,18 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path,
a multiway branch, in which case we have deemed it worth losing
other loop optimizations later.
- We also consider it worth creating an irreducible inner loop if
- the number of copied statement is low relative to the length of
- the path -- in that case there's little the traditional loop
- optimizer would have done anyway, so an irreducible loop is not
- so bad. */
+ We also consider it worth creating an irreducible inner loop after
+ loop optimizations if the number of copied statement is low. */
if (!m_threaded_multiway_branch
&& *creates_irreducible_loop
- && (m_n_insns * (unsigned) param_fsm_scale_path_stmts
- > (m_path.length () *
- (unsigned) param_fsm_scale_path_blocks)))
-
+ && (!(cfun->curr_properties & PROP_loop_opts_done)
+ || (m_n_insns * param_fsm_scale_path_stmts
+ >= param_max_jump_thread_duplication_stmts)))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
- " FAIL: Would create irreducible loop without threading "
- "multiway branch.\n");
+ " FAIL: Would create irreducible loop early without "
+ "threading multiway branch.\n");
/* We compute creates_irreducible_loop only late. */
return false;
}