On 8/6/24 7:12 AM, Richard Biener wrote:
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).

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

OK if that succeeds?

Thanks,
Richard.

        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.
Definitely OK if it succeeds. I wouldn't expect any testsuite fallout from the various dump/assembly scan tests.

jeff

Reply via email to