[PATCH] Allow fully resolving backward jump threading passes.

Jeff Law jeffreyalaw@gmail.com
Fri Oct 15 14:40:44 GMT 2021



On 10/15/2021 8:25 AM, Aldy Hernandez wrote:
> This refactors the backward threader pass so that it can be called in
> either fully resolving mode, or in classic mode where any unknowns
> default to VARYING.  Doing so opens the door for
> "pass_thread_jumps_full" which has the resolving bits set.
>
> This pass has not been added to the pipeline, but with it in place, we
> can now experiment with it to see how to reduce the number of
> jump threaders.  The first suspect will probably be enabling fully
> resolving in the backward threader pass immediately preceeding VRP2,
> and removing the VRP2 threader pass.  Now that VRP and the backward
> threader are sharing a solver, and most of the threads get handcuffed
> by cancel_threads(), we should have a variety of scenarios to try.
>
> In the process, I have cleaned up things to make it trivial to see
> what the difference between the 3 variants are (early jump
> threading, quick jump threading without resolving SSAs, and fully
> resolving jump threading).  Since I moved stuff around, it's probably
> easier to just look at the last section in tree-ssa-threadbackward to
> see how it's all laid out.
>
> No functional changes as the new pass hasn't been added to the
> pipeline.
>
> OK pending tests?
>
> gcc/ChangeLog:
>
> 	* tree-pass.h (make_pass_thread_jumps_full): New.
> 	* tree-ssa-threadbackward.c (pass_thread_jumps::gate): Inline.
> 	(try_thread_blocks): Add resolve and speed arguments.
> 	(pass_thread_jumps::execute): Inline.
> 	(do_early_thread_jumps): New.
> 	(do_thread_jumps): New.
> 	(make_pass_thread_jumps):
> 	(pass_early_thread_jumps::gate): Inline.
> 	(pass_early_thread_jumps::execute): Inline.
> 	(class pass_thread_jumps_full): New.
OK.
jeff



More information about the Gcc-patches mailing list