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

Renato Golin rengolin at systemcall.org
Wed Oct 28 13:10:49 PDT 2009


2009/10/28 Chandler Carruth <chandlerc at google.com>:
> Surviving new and different uses
> *is* the purpose of a good interface.

I don't have much to add to this interesting discussion, just like to
remind people that changes in the default behaviour are only
acceptable (IMHO) when everybody (but a few legacy code) is NOT using
(or should not use) the current default behaviour.

The counter example (and a good point when not to change the default
even when it's dangerous) is the strcpy() in the libc. It's dangerous,
malicious, bearing stupid, but still there. You have the strncpy (and
all associated variants) but it's not compulsory nor the default
behaviour.

Creating another method (getLazyFunctionPointer) or passing a boolean,
enum, whatever seems like the best course of action right now.

I understand that passing lots of Function*s to the JIT and only
generating what's really executed would be "nice" but (as was pointed
out before) this is signal of bad code. You should only pass to the
JIT what's really going to be executed, and I guess it's not that hard
to do the "lazy evaluation" on your side.

My 2 cents...

cheers,
--renato

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm



More information about the llvm-dev mailing list