Auto-vectorizer can be a great help in vectorizing simple instructions with SIMD instruction calls.
int a[COUNT]; int b[COUNT]; int c[COUNT]; for(int i=0; i<COUNT; ++i) { a[i] = b[i] + c[i]; }
But a simple conditional check is enough to break the auto-vectorizer.
for(int i=0; i<COUNT; ++i) { // a conditional check breaks the auto-vectorizer if(b[i] > X && b[i] < Y) a[i] = b[i] + c[i]; }
I hereby propose to Intel to add a new set of conditional SIMD whereby all SIMD instructions to accept an additional operand of a vector of booleans. Only when the boolean is true, then the instruction proceeds with the operations. Whereas the original SIMD instruction set will be retained, in order not to break all existing applications but their calls will automatically be redirected to conditional SIMD with a vector of booleans implicitly all set to true. This is to save the silicon estate on the chip.