Twice now, we've had to debug pretty awful codegen bugs where the
indirect target of an INLINEASM_BR was removed by BranchFolding.
In both cases, this was a cascaded failure caused earlier, and not
necessarily BranchFolding's fault. For that reason, I don't think it's
appropriate to always guard against removing MachineBasicBlocks that
have their address taken; this is indicative of something else going
wrong earlier.
Rather than proceed to generate jumps to blocks that have been removed,
which is quite hard to debug (the generated code), add an assertion to
help catch and hint at similar failures in the future.
The first conditional added is false for all tests currently in tree,
but this exceptional case is true for the test case in D77849. When
D77849 is resolved this exceptional cases should hopefully never be
true, but the assertion is still useful to catch regressions or help
find if there's more bugs lying in wait.
D78166 is also related, and will cause the assertions added in
D78166 to fire before this added assertion, for the test case in
D77849.
It would be better to expand the comment, instead of incorporating the review by reference.