On Mon, Jun 06, 2016 at 10:05:57AM +0200, Richard Biener wrote: > So this ends up generating { a ? -1 : 0, b ? -1 : 0, ... }. That
Yes, that is already what we do now for loop vectorization. > might be less optimal than doing { a, b, ... } ? { -1, -1 ... } : { 0, 0, > .. } Well, it would need to be { a, b, ... } != { 0, 0, ... } ? { -1, -1, ... } : { 0, 0, ... } then, doesn't VEC_COND_EXPR assume the condition is in canonical VECTOR_BOOLEAN_TYPE_P form? Anyway, if something like the above would be faster, perhaps generic vector lowering or some similar pass could detect that case post-vectorization and optimize? Jakub