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