There was a limitation that in the inner loop latch, no instruction was allowed between induction variable increment and branch in the inner loop latch. This is because we used to split the inner latch at the induction variable increment instruction. Since now we have split at the inner latch branch instruction and have moved instructions properly, we remove this limitation.
As an example, please refer to interchange_10() in test/Transforms/LoopInterchange/interchangeable.ll for the interchanged loop generated after loop interchange:
The inner latch is BB for2. When this pass was introduced very early on, it would split for2 at %j.next = add nuw nsw i64 %j, 1, and all instructions after %j.next would go into the split BB which will become the new outer latch. This causes incorrectness and hence the limitation that
" no instruction was allowed between induction variable increment and branch in the inner loop latch" was introduced initially.
Right now we split at the branch instruction of for2, and we duplicate %j.next = add nuw nsw i64 %j, 1 and %exitcond = icmp eq i64 %j, 99 into for2.split which becomes the new outer latch. Instructions in the original inner latch stay where they are. Hence the limitation can be removed.
Hope my explanation is clear, if there is any confusion please feel free to comment.