It would be nice if -fsanitize=signed-integer-overflow would impact optimization less, so it could be used in production more often. In the following example, using this flag prevents vectorization: void f(int i, float * restrict a, float * restrict b) { for (int j = i; j < i + 4; ++j) a[j] = b[j] + 1.; } https://godbolt.org/z/raqdd794x
You could in theory version the loop for the no overflow case. Now is the question becomes is it worth the cost of implementing it in the compiler. I doubt it.
Clang seems to do a combined check before the loop without creating a new version.