aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-09-02 20:38:11 -0700
committerAndrew Pinski <quic_apinski@quicinc.com>2024-09-03 16:38:03 -0700
commit77e17558fcda8992fbe731ccd12bde445e48d6f4 (patch)
tree9fb7fd117dafb293dc77ff3ec8bea92d22ec2c4d
parentf9642ffe7814396f31203f4366f78a43a01a215c (diff)
downloadgcc-77e17558fcda8992fbe731ccd12bde445e48d6f4.zip
gcc-77e17558fcda8992fbe731ccd12bde445e48d6f4.tar.gz
gcc-77e17558fcda8992fbe731ccd12bde445e48d6f4.tar.bz2
split-paths: Move check for # of statements in join earlier
This moves the check for # of statements to copy in join to be the first check. This check is the cheapest check so it should be first. Plus add a print to the dump file since there was none beforehand. gcc/ChangeLog: * gimple-ssa-split-paths.cc (is_feasible_trace): Move check for # of statments in join earlier and add a debug print. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
-rw-r--r--gcc/gimple-ssa-split-paths.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/gimple-ssa-split-paths.cc b/gcc/gimple-ssa-split-paths.cc
index 8b4304f..81a5d1d 100644
--- a/gcc/gimple-ssa-split-paths.cc
+++ b/gcc/gimple-ssa-split-paths.cc
@@ -167,6 +167,19 @@ is_feasible_trace (basic_block bb)
int num_stmts_in_pred2
= EDGE_COUNT (pred2->succs) == 1 ? count_stmts_in_block (pred2) : 0;
+ /* Upper Hard limit on the number statements to copy. */
+ if (num_stmts_in_join
+ >= param_max_jump_thread_duplication_stmts)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ "Duplicating block %d would be too duplicate "
+ "too many statments: %d >= %d\n",
+ bb->index, num_stmts_in_join,
+ param_max_jump_thread_duplication_stmts);
+ return false;
+ }
+
/* This is meant to catch cases that are likely opportunities for
if-conversion. Essentially we look for the case where
BB's predecessors are both single statement blocks where
@@ -406,12 +419,6 @@ is_feasible_trace (basic_block bb)
/* We may want something here which looks at dataflow and tries
to guess if duplication of BB is likely to result in simplification
of instructions in BB in either the original or the duplicate. */
-
- /* Upper Hard limit on the number statements to copy. */
- if (num_stmts_in_join
- >= param_max_jump_thread_duplication_stmts)
- return false;
-
return true;
}