If instructions that have side effects are guarded by control flow,
the order of execution might differ after interchanging the loops
and results in incorrect behaviour (the branch condition may depends
on the execution order).
This fixes https://bugs.llvm.org/show_bug.cgi?id=48057
BB3 should not guarded by a loop variant block, but this function would return BB1, BB2, and BB3.