This is a straightforward extension of what LoopUnswitch does to
branches to guards. That is, we unswitch
for (;;) {
...
guard(loop_invariant_cond);
...
}into
if (loop_invariant_cond) {
for (;;) {
...
// There is no need to emit guard(true)
...
}
} else {
for (;;) {
...
guard(false);
// SimplifyCFG will clean this up by adding an
// unreachable after the guard(false)
...
}
}
Perhaps "That loops don't contain ..."