If a Phi takes a previous phi in the same block as input, the phi
becomes loop invariant in the same iteration as the input.
For example, both %a and %b become loop invariant on the second
iteration:
for (...) {
%a = phi(0, %invariant)
%b = phi(1, %a)
}The peeling with size limit test is modified to test its intended use
case.
The current patch doesn't apply cleanly on main so I cannot check, but is this covered by a test?