Currently isLoopExiting returns true for BBs that are not part of the
loop. To avoid hiding subtle bugs, this patch adds an assertion to make
sure the passed BB is inside the loop. Alternatively, we could return
false for BBs outside the loop, but I think it makes sense to restrict
it to BBs inside a loop.
Just one use in AMDGPUTTIImpl needed updating.
This seems substantially different from the original logic. Probably it should be if (!L->contains(Succ0) || L->isLoopExiting(Succ0) || [...]... which would be effectively the same as the original logic in most cases. Given a loop in LoopSimplify form, the only case I can think of where it wouldn't be the same is if Succ0 or Succ1 has no successors (ends in a "ret" or "unreachable").