Jakub Jelinek <ja...@redhat.com> writes: > Of course it can be done efficiently, what we care most is that the body of > the vectorized loop is efficient.
That's fair, I was looking at the x86 assembly being generated when a single vectorized iteration was enough (because that is the context in which I first encountered this bug): int f(unsigned int *x, unsigned int k) { unsigned int result = 8; for (unsigned int i = 0; i < 8; i++) { if (x[i] == k) result = i; } return result; } where the vpand instruction this generates would have to be replaced with a variable blend if the default value weren't 0 — although I had not realized even SSE4.1 on x86 includes such an instruction, making this point less relevant. > Thanks, it applies cleanly now > > + else if ((STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info) == COND_REDUCTION > > + || (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info) > > + == INTEGER_INDUC_COND_REDUCTION)) > > + && reduc_fn == IFN_LAST)» > > contains a character at the end of line that makes it not to compile. My bad, I must have added this when I opened the patch file itself to inspect it... > Another thing is, as your patch is quite large, we need a copyright > assignment for the changes before we can accept it, see > https://gcc.gnu.org/contribute.html for details. > > If you are already covered by an assignment of some company, please tell > us which one it is, otherwise contact us and we'll get you the needed > forms. I am not covered by any copyright assignment yet. Do I need to send you any additional information?