[LLVMdev] Should LLVM JIT default to lazy or non-lazy?

Jeffrey Yasskin jyasskin at google.com
Wed Oct 28 14:24:58 PDT 2009


On Wed, Oct 28, 2009 at 1:32 PM, Chris Lattner <clattner at apple.com> wrote:
> On Oct 28, 2009, at 1:10 PM, Renato Golin wrote:
>> Creating another method (getLazyFunctionPointer) or passing a boolean,
>> enum, whatever seems like the best course of action right now.
>>
>
>
> I think that this is a great idea.  Instead of making "lazy or not" be
> a policy maintained by the JIT, why don't we approach this as a bug in
> the current API.  Perhaps we should remove getPointerToFunction() and
> introduce two new methods (one lazy and one eager)?

That'd work for me. I just care that it's not easy to stumble into the
thread-unsafe option (and that I have an obvious place to put the
comment). I think I'll need to add the lazy/eager choice to
getPointerToGlobal() and getOrEmitGlobalVariable() too since they can
call into the code generator.
I'd lean toward adding an enum parameter instead of additional
function names since most of the operation will be the same internally
anyway. Does that sound good?




More information about the llvm-dev mailing list