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

--- Comment #7 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
Update the analysis:

We failed to recognize it as reduction because, the PHI result has 2 uses:

# result_20 = PHI <result_9(8), 0(18)>
...
_11 = result_20 + 10;   --------> first use
result_17 = _4 + _11;
_23 = _4 > _7;
result_9 = _23 ? result_17 : result_20;  -----> second use

It seems that it is the if-conversion issue which makes loop vectorizer failed
to vectorize it.

I have checked LLVM implementation, their "result" ssa always has single use no
matter how I modify the codes (for example, result += a[i] + b[i] + c[i]).

Reply via email to