[llvm-dev] Terminators in MachineBasicBlock
Quentin Colombet via llvm-dev
llvm-dev at lists.llvm.org
Thu Mar 24 13:32:16 PDT 2016
> On Mar 24, 2016, at 11:23 AM, Tom Chen <cyt046 at gmail.com> wrote:
>
> So in your example there are two terminators in the basic block (`br if` and `br else`)?
Yes.
>
> 2016-03-24 14:15 GMT-04:00 Quentin Colombet <qcolombet at apple.com <mailto:qcolombet at apple.com>>:
> Hi,
>
> > On Mar 24, 2016, at 10:58 AM, Tom Chen via llvm-dev <llvm-dev at lists.llvm.org <mailto: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 <mailto:llvm-dev at lists.llvm.org>
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <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/7685a097/attachment.html>
More information about the llvm-dev
mailing list