Terminators in MachineBasicBlock

Hi,
Why does a MachineBasicBlock have multiple terminator instructions (unlike BasicBlock, which can only have one) ?
Thanks,
Tom

Hi,

Hi,
Why does a MachineBasicBlock have multiple terminator instructions (unlike BasicBlock, which can only have one) ?

Think of it as predicated instructions.
E.g.,
bool = icmp
if bool : br if
br else

As for why, we could indeed have split those terminators into several basic blocks, but it would have required more MachineBasicBlock objects.

Cheers,
-Quentin

So in your example there are two terminators in the basic block (br if and br else)?

So in your example there are two terminators in the basic block (br if and br else)?

Yes.