[llvm-dev] LLVM Block is not the basic block

Muhui Jiang via llvm-dev llvm-dev at lists.llvm.org
Tue May 29 06:49:46 PDT 2018


Hi Krzysztof

I see and I agree with your explanation

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.

Regards
Muhui

2018-05-29 21:20 GMT+08:00 Krzysztof Parzyszek via llvm-dev <
llvm-dev at lists.llvm.org>:

> On 5/29/2018 7:59 AM, Muhui Jiang via llvm-dev wrote:
>
>> So the reason why basic blocks can contain function calls is because of
>> code inlining?
>>
>
> 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.
> 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.
>
> -Krzysztof
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by The Linux Foundation
> _______________________________________________
> 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/20180529/ec011e8b/attachment.html>


More information about the llvm-dev mailing list