On Mon, Aug 24, 2026 at 6:26 PM Richard Biener <[email protected]> wrote:
>
> The following makes sure to hoist loop invariants after unswitching
> a loop.  Invariant stmts in a loop can make vectorization less
> effective and now confuse it.  While if-conversion moves invariants
> already, when there's nothing to if-convert this isn't done.  This
> follows what loop interchange and unroll-and-jam already do.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
>
> On x86 this will cause
>
> FAIL: gcc.target/i386/pr125238.c scan-assembler movabsq[\\\\t]+\\\\\$858993459
> 4, %r[a-z0-9]+
> FAIL: gcc.target/i386/pr89523-1a.c scan-assembler addr32 vgather
> FAIL: gcc.target/i386/pr89523-1b.c scan-assembler addr32 vgather
>
> all are testisms, I have not quickly figured how to preserve what those
> intended to test, but the patch will reduce the fallout from the
> recent vectorizer changes, so I'll leave those for followups.
>
>         PR tree-optimization/126997
>         * tree-ssa-loop-unswitch.cc (tree_ssa_unswitch_loops):
>         Perform invariant motion when we unswitched a loop.
>
>         * gcc.dg/torture/pr126997.c: New testcase.

This caused:

FAIL: gcc.target/i386/pr125238.c scan-assembler movabsq[
\\t]+\\$8589934594, %r[a-z0-9]+
FAIL: gcc.target/i386/pr89523-1a.c scan-assembler addr32 vgather
FAIL: gcc.target/i386/pr89523-1b.c scan-assembler addr32 vgather

on Linux/x86-64.

-- 
H.J.

Reply via email to