<div dir="ltr">Hi Krzysztof<div><br></div><div>I see and I agree with your explanation</div><div><br></div><div>However, you know some start of art binary analysis tools like angr will accept LLVM's such kind of design. You know there are some non-return functions. Does LLVM consider this?  Do you have any ideas if I want to create a block that cannot contain function calls with LLVM IR.</div><div><br></div><div>Regards</div><div>Muhui</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-29 21:20 GMT+08:00 Krzysztof Parzyszek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 5/29/2018 7:59 AM, Muhui Jiang via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So the reason why basic blocks can contain function calls is because of code inlining?<br>
</blockquote>
<br></span>
Not really. Basic blocks are units of code in a context of a specific function. When execution reaches a function call, it will go outside of the current function for some time, but then it will return back to the instruction following the call. From the perspective of the function containing the call, the call is simply another (potentially complicated and long-running) instruction.<br>
Generally speaking, a basic block ends at instruction A, if the instruction following A is not guaranteed to execute after A has executed. From the point of view of a given function, a call to another function will return back to the caller, so logically there is no reason to terminate the basic block at a call. There are of course complications, like calls that can throw exceptions, or calls that don't return, but the general idea is that calls do return.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Krzysztof<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div>