Loop split on semi-invariant conditional statement

Programming / Compilers / GCC - fxue [138bc75d-0d04-0410-961f-82ee72b054a4] - 7 November 2019 15:43 EST

2019-11-07 Feng Xue

PR tree-optimization/89134
- doc/invoke.texi (min-loop-cond-split-prob): Document new --params.
- params.def: Add min-loop-cond-split-prob.
- tree-ssa-loop-split.c (split_loop): Remove niter parameter, move some outside checks on loop into the function. (split_info): New class. (find_vdef_in_loop, get_control_equiv_head_block): New functions. (find_control_dep_blocks, vuse_semi_invariant_p): Likewise. (ssa_semi_invariant_p, loop_iter_phi_semi_invariant_p): Likewise. (control_dep_semi_invariant_p, stmt_semi_invariant_p_1): Likewise. (stmt_semi_invariant_p, branch_removable_p): Likewise. (get_cond_invariant_branch, compute_added_num_insns): Likewise. (get_cond_branch_to_split_loop, do_split_loop_on_cond): Likewise. (split_loop_on_cond): Likewise. (tree_ssa_split_loops): Add loop split on conditional statement.

2019-11-07 Feng Xue

PR tree-optimization/89134
- gcc.dg/tree-ssa/loop-cond-split-1.c: New test.
- g++.dg/tree-ssa/loop-cond-split-1.C: New test.
- gcc.dg/torture/pr55107.c: Add -fno-split-loops.

210e2303be5 Loop split on semi-invariant conditional statement
gcc/ChangeLog | 18 +
gcc/doc/invoke.texi | 5 +
gcc/params.def | 6 +
gcc/testsuite/ChangeLog | 7 +
gcc/testsuite/g++.dg/tree-ssa/loop-cond-split-1.C | 33 +
gcc/testsuite/gcc.dg/torture/pr55107.c | 1 +
gcc/testsuite/gcc.dg/tree-ssa/loop-cond-split-1.c | 97 ++
gcc/tree-ssa-loop-split.c | 1023 ++++++++++++++++++++-
8 files changed, 1162 insertions(+), 28 deletions(-)

Upstream: gcc.gnu.org


  • Share