A small IR change in calculating the active lanes resulted in no longer recognising tail-predication. We used to calculate a vector containing the iteration counts for a vector body with e.g. 4 iterations with:
[i, i, i, i] + [0, 1, 2, 3]
but this is changed to:
[i, i, i, i] or [0, 1, 2, 3]
when this result is compared to the vector with loop iteration count vector [N, N, N, N] then this is equivalent, so now recognise both the 'add' and 'or'.
I think if this was using an or it was because the BroadcastSplat value is mod Lanes. That is OK here because BroadcastSplat is IV which we know is a phi with 0 start and Lanes increment?
If so, can you add a comment that we know that it will be aligned, so an Or is equivalent to an Add?