Hi, Why does a MachineBasicBlock have multiple terminator instructions (unlike BasicBlock, which can only have one) ? Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160324/86ab8873/attachment-0001.html>
Quentin Colombet via llvm-dev
2016-Mar-24 18:15 UTC
[llvm-dev] Terminators in MachineBasicBlock
Hi,> On Mar 24, 2016, at 10:58 AM, Tom Chen via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > 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> Thanks, > Tom > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
So in your example there are two terminators in the basic block (`br if` and `br else`)? 2016-03-24 14:15 GMT-04:00 Quentin Colombet <qcolombet at apple.com>:> Hi, > > > On Mar 24, 2016, at 10:58 AM, Tom Chen via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > 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 > > Thanks, > > Tom > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160324/6598ec52/attachment.html>