[LLVMdev] Is LLVM expressive enough to represent asynchronous exceptions?

Renato Golin rengolin at systemcall.org
Mon Jun 13 01:45:25 PDT 2011


On 13 June 2011 05:39, Sohail Somani <sohail at taggedtype.net> wrote:
> So how could you represent this in a CFG? Is it enough to assume that
> signals can occur only after every instruction?

Hi Sohail,

I don't think so. If an instruction is taking a long time to execute
(IR instructions can be expanded into multiple instructions or even
function calls) and a software interruption comes, it must be dealt
with immediately.


> Should you represent it in a CFG?

Even if a basic block has unwind information, it doesn't mean that the
exception that is coming is meant to that unwind block. If an
asynchronous exception is thrown from another thread (or from the OS,
or whatever), there is no way the current execution flow can guess
what did that mean and act accordingly.

However, signal handlers are simply function pointers registered in a
structure that the OS is responsible for dispatching to. They can
occur at any time for any external reason, so there is no point in
putting all signal handlers' information on every basic block.

cheers,
--renato



More information about the llvm-dev mailing list