On 9/15/2021 2:46 AM, Martin Liška wrote:
Hello.

The patch extends the loop unswitching pass so that gswitch
statements are supported. The pass now uses ranger which marks
switch edges that are known to be unreachable in a versioned loop.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

    * tree-cfg.c (gimple_lv_add_condition_to_bb): Support non-gimple
    expressions that needs to be gimplified.
    * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Add new
    cond_edge parameter.
    (tree_may_unswitch_on): Support gswitch statements.
    (clean_up_switches): New function.
    (tree_ssa_unswitch_loops): Call clean_up_switches.
    (simplify_using_entry_checks): Removed and replaced with ranger.
    (tree_unswitch_single_loop): Change assumptions.

gcc/testsuite/ChangeLog:

    * gcc.dg/loop-unswitch-6.c: New test.
    * gcc.dg/loop-unswitch-7.c: New test.
    * gcc.dg/loop-unswitch-8.c: New test.
    * gcc.dg/loop-unswitch-9.c: New test.
LGTM.  OK.
Jeff

Reply via email to