Hello,
The patch teaches ScalarEvolution to compute trip count for loops such as these-
for(int i=0; i<n; i+=s) { A[i] = i; }
The basic idea is that if the IV has a nsw/nuw flag and loop has no side effects then we can assume the direction of the loop and compute the correct backedge taken count.
This code is incorrect for masked store and scatter. It returns true for simple store, but false for the masked intrinsics.
As a result we can't calculate trip count for the loop "j" after vectorization of the loop "i":
for (int = 0; j < jCount; j+=Step) {