This reverts commit 897d8ee5, due to causing an infinite loop when encountering a loop with a sub-region with an inner loop.