[LLVMdev] Is LLVM expressive enough to represent asynchronous exceptions?
Andrew Trick
atrick at apple.com
Tue Jun 14 10:07:41 PDT 2011
On Jun 14, 2011, at 9:20 AM, Chris Lattner wrote:
> The point of this, for me, is that we need to distinguish in the IR a load that can trap with defined behavior (e.g. Java) from a load that cannot (e.g. C). Given that you need to capture this in the IR, it "simply" becomes a matter of exposing the right info at the Machine level as well. It turns out that just doing this at the IR level is full of tradeoffs and compromises, and hasn't been important enough for anyone to drive forward yet.
It's also worth pointing out that Java can only trap on null pointer loads, assuming type checks remain. In that case, the trapping condition can be trivially expressed at the IR level, and whether H/W or S/W checks are ultimately emitted becomes a CodeGen detail. In fact, Java null checks are often removed by generic compiler optimization when expressed this way.
I wonder if anyone cares about defined behavior (unwind+resume) from trapping loads when the trapping condition cannot already be expressed in the IR.
-Andy
More information about the llvm-dev
mailing list