Fixed a bug in loop vectorization with conditional store.
The following loop should be easily vectorized on targets with masked store:
unsigned int a[256], b[256];
void foo() {
for (int i = 0; i < 256; i++) {
if (b[i] > a[i])
a[i] = b[i];
}
}The loop in the example calculates MAX value.
In the future, this loop should produce PMAX + store. But in the current version the function remains scalar due to the bug in masked store.
Any other loop without MAX pattern needs this fix anyway.