Skip to content
Snippets Groups Projects
Commit 2cf89ae8 authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

tree-optimization/116166 - forward jump-threading going wild

Currently the forward threader isn't limited as to the search space
it explores and with it now using path-ranger for simplifying
conditions it runs into it became pretty slow for degenerate cases
like compiling insn-emit.cc for RISC-V esp. when compiling for
a host with LOGICAL_OP_NON_SHORT_CIRCUIT disabled.

The following makes the forward threader honor the search space
limit I introduced for the backward threader.  This reduces
compile-time from minutes to seconds for the testcase in PR116166.

Note this wasn't necessary before we had ranger but with ranger
the work we do is quadatic in the length of the threading path
we build up (the same is true for the backwards threader).

	PR tree-optimization/116166
	* tree-ssa-threadedge.h (jump_threader::thread_around_empty_blocks):
	Add limit parameter.
	(jump_threader::thread_through_normal_block): Likewise.
	* tree-ssa-threadedge.cc (jump_threader::thread_around_empty_blocks):
	Honor and decrement limit parameter.
	(jump_threader::thread_through_normal_block): Likewise.
	(jump_threader::thread_across_edge): Initialize limit from
	param_max_jump_thread_paths and pass it down to workers.
parent 9db55ec0
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment