diff options
author | Richard Biener <rguenther@suse.de> | 2023-01-11 12:07:16 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-01-11 12:59:12 +0100 |
commit | 7c9f20fcfdc2d8453df88ceb7e693debfcd678c0 (patch) | |
tree | ae9ddd3b4be364259c04da871207ce9c95921efd /gcc/function.cc | |
parent | 445a48a226ffd530b37bcdc13b6bdca94ba2e122 (diff) | |
download | gcc-7c9f20fcfdc2d8453df88ceb7e693debfcd678c0.zip gcc-7c9f20fcfdc2d8453df88ceb7e693debfcd678c0.tar.gz gcc-7c9f20fcfdc2d8453df88ceb7e693debfcd678c0.tar.bz2 |
tree-optimization/108352 - FSM threads creating irreducible loops
The following relaxes a heuristic that prevents creating irreducible
loops from FSM threads not covering multi-way branches. Instead of
allowing threads that adhere to
&& (n_insns * (unsigned) param_fsm_scale_path_stmts
> (m_path.length () *
(unsigned) param_fsm_scale_path_blocks))
with reasoning "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." that I cannot make much
sense of the following patch changes that to only allow those after
loop optimization and when they are (scaled) short:
&& (!(cfun->curr_properties & PROP_loop_opts_done)
|| (m_n_insns * param_fsm_scale_path_stmts
>= param_max_jump_thread_duplication_stmts)))
This allows us to get rid of --param fsm-scale-path-blocks which
previous to the bisected revision allowed an enlarged path covering
the original allowance (but we do not consider that enlarged path
now because enlarging it doesn't add any information).
PR tree-optimization/108352
* tree-ssa-threadbackward.cc
(back_threader_profitability::profitable_path_p): Adjust
heuristic that allows non-multi-way branch threads creating
irreducible loops.
* doc/invoke.texi (--param fsm-scale-path-blocks): Remove.
(--param fsm-scale-path-stmts): Adjust.
* params.opt (--param=fsm-scale-path-blocks=): Remove.
(-param=fsm-scale-path-stmts=): Adjust description.
* gcc.dg/tree-ssa/ssa-thread-21.c: New testcase.
* gcc.dg/tree-ssa/vrp46.c: Remove --param fsm-scale-path-blocks=1.
Diffstat (limited to 'gcc/function.cc')
0 files changed, 0 insertions, 0 deletions