[LLVMdev] Re: Newbie questions

Chris Lattner sabre at nondot.org
Wed Apr 26 13:23:18 PDT 2006

On Wed, 26 Apr 2006, Vikram Adve wrote:
>> On some platforms we generate explicit checks for null pointer
>> dereferences and for division by zero (division is a bit different in
>> that we also have to handle java's special rule for dividing -1 by the
>> minimum integer -- I think most platforms actually call the helper
>> function).

> Specifically, I don't think either of these approaches will be sufficient 
> when using LLVM as a JIT in libgcj.  In either case, an LLVM optimization 
> could still reorder trapping instructions.  In the first approach, this is 
> less likely to occur but is possible.  The second approach of course wouldn't 
> work because LLVM doesn't have a notion of implicitly trapping instructions 
> and could merrily reorder such operations.

Vikram, I'm confused.  How do you think LLVM will break this?  It will 
never introduce a trapping operation on a path without a trap, and the 
approach above doesn't require the ability to distinguish between traps: 
in fact, any trap would be a fatal error.

Please explain specifically what you think is an issue, so I can 




More information about the llvm-dev mailing list