https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109088

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
I don't think strip_nop_cond_scalar_reduction is the place to adjust here,
maybe it's the caller.  I don't have time to dig into the specific issue right
now but if we require scalar code adjustments then we need to perform those in
if-conversion.

But to me it looks like allowing

> > STMT 1. tmp = a[i] + x;
> > STMT 2. tmp2 = tmp + result_ssa_1;
> > STMT 3. result_ssa_2 = mask ? tmp2 : result_ssa_1;

in vect_is_simple_reduction might also be a reasonable approach.  The
use in the COND_EXPR isn't really a use - it's a conditional update.

Reply via email to