MBB reordering vs. MBB fall-through


Is it valid for an MBB to not have a final unconditional jump if the jump would be to the next MBB anyway? If yes, how is that supposed to interact with MBB reordering?

I'm asking because I've encountered a problem with the AVR backend where an MBB falls through to the wrong MBB due to reordering, and I'd like to know if the problem is having fall-throughs in the first place, or not communicating their presence somehow with other parts of LLVM.


That is valid. Passes that want to reorder basic blocks should only do
so if the AnalyzeBranch and related target hooks (Insert/Remove) allow
it. They're capable of reconstructing the branches so they point to
arbitrary destinations.