<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 24, 2016, at 11:23 AM, Tom Chen <<a href="mailto:cyt046@gmail.com" class="">cyt046@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">So in your example there are two terminators in the basic block (`br if` and `br else`)?</div></div></blockquote><div><br class=""></div><div>Yes.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">2016-03-24 14:15 GMT-04:00 Quentin Colombet <span dir="ltr" class=""><<a href="mailto:qcolombet@apple.com" target="_blank" class="">qcolombet@apple.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="">
<span class=""><br class="">
> On Mar 24, 2016, at 10:58 AM, Tom Chen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> Hi,<br class="">
> Why does a MachineBasicBlock have multiple terminator instructions (unlike BasicBlock, which can only have one) ?<br class="">
<br class="">
</span>Think of it as predicated instructions.<br class="">
E.g.,<br class="">
bool = icmp<br class="">
if bool : br if<br class="">
br else<br class="">
<br class="">
As for why, we could indeed have split those terminators into several basic blocks, but it would have required more MachineBasicBlock objects.<br class="">
<br class="">
Cheers,<br class="">
-Quentin<br class="">
> Thanks,<br class="">
> Tom<br class="">
> _______________________________________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>