On 7/28/23 01:05, Richard Biener via Gcc-patches wrote:
The following delays sinking of loads within the same innermost
loop when it was unconditional before.  That's a not uncommon
issue preventing vectorization when masked loads are not available.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

I have a followup patch improving sinking that without this would
cause more of the problematic sinking - now that we have a second
sink pass after loop opts this looks like a reasonable approach?

OK?

Thanks,
Richard.

        PR tree-optimization/92335
        * tree-ssa-sink.cc (select_best_block): Before loop
        optimizations avoid sinking unconditional loads/stores
        in innermost loops to conditional executed places.

        * gcc.dg/tree-ssa/ssa-sink-10.c: Disable vectorizing.
        * gcc.dg/tree-ssa/predcom-9.c: Clone from ssa-sink-10.c,
        expect predictive commoning to happen instead of sinking.
        * gcc.dg/vect/pr65947-3.c: Adjust.
I think it's reasonable -- there's probably going to be cases where it's not great, but more often than not I think it's going to be a reasonable heuristic.

If there is undesirable fallout, better to find it over the coming months than next spring. So I'd suggest we go forward now to give more time to find any pathological cases (if they exist).

Jeff

Reply via email to