On 2/29/24 01:35, Richard Biener wrote:
The following amends the PR114070 fix to optimistically allow
the folding when we cannot expand the current vec_cond using
vcond_mask and we're still before vector lowering.  This leaves
a small window between vectorization and lowering where we could
break vec_conds that can be expanded via vcond{,u,eq}, most
susceptible is the loop unrolling pass which applies VN and thus
possibly folding to the unrolled body of a vectorized loop.

This gets back the folding for targets that cannot do vectorization.
It doesn't get back the folding for x86 with AVX512 for example
since that can handle the original IL but not the folded since
it misses some vcond_mask expanders.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

As said for stage1 I want to move vector lowering before vectorization.
While I'm not entirely happy with this patch it forces us into the
correct direction, getting vcond_mask and vcmp{,u,eq} patterns
implemented.  We could use canonicalize_math_p () to close the
vectorizer -> vector lowering gap but this only works when that
pass is run (not with -Og or when disabled).  We could add a new
PROP_vectorizer_il and disable the folding if the vectorizer ran.

Or we could simply live with the regression.

Any preferences?
Not really. As I think I said, I consider the regression insignificant an I could certainly live with it.

jeff

Reply via email to