IfWhen the loop has a predictable back-edge count and we have another IV (say IV-B)IV is only used by the terminating condition (say IV-A) and the loop
that is an affine add recursion,has a predictable back-edge count and we will be able to calculate the terminatinghave another IV (say IV-B) that is an
value of IV-B in the loop preheader.affine add recursion, This patch adds attempts to replace IV-Bwe will be able to calculate the terminating value of
as the new terminating condition and remove IV-AIV-B in the loop pre-header. It is safe to do so whenThis patch adds attempts to replace IV-AB as the
is new terminating condition and remove IV-A. It is safe to do so since IV-A is
only used as the terminating condition.
This transformation is suitable to be appended after LSR as it may optimize the
lopp into the situation mentioned above. The transformation can reduce number of
IV-s in the loop by one.