When erasing an instruction, we can erase the one which is the first implicit
control flow instruction in the block. This will invalidate the respective map.
This patch ensures that we re-calculate the FirstImplicitControlFlowInsts for
a block every time we remove the first implicit CF instruction.
It is the fix for bug introduced in https://reviews.llvm.org/D37460; these two
patches should be merged together and are only separated for convenience
of review.
This assertion doesn't look correct. Your message says the instruction doesn't have implicit control flow, the actual assert says it's not the first in the basic block. One or the other needs fixed.