[LLVMdev] [RFC] NoBuiltin Attribute

Joerg Sonnenberger joerg at britannica.bec.de
Mon Feb 18 20:58:09 PST 2013


On Mon, Feb 18, 2013 at 06:10:48PM -0800, Chris Lattner wrote:
> Out of curiosity, how important is -fno-builtin-foo?

Depends, does that include alloca and the object size stuff?

> Isn't it enough to just have -fno-builtin-foo disable *all* builtin
> optimizations for the unit of code being compiled?  This is overly
> conservative - is that actually a problem for something?

Making -fno-builtin-foo imply -fno-builtin seems overly aggressively. I
can imagine wanting to use the former when implementing libc to get more
predictable behavior, but still wanting to get e.g. the string
optimisations.

As I mentioned on IRC, there is also the related issue of explicitly
requesting a builtin, i.e. a positive __attribute__((__builtin__)) for
freestanding code. I don't think that -fno-builtin-puts should imply
-fno-builtin-printf.  It should apply to function calls in this module,
but may be merged by adding the nobuiltin attribute to the prototypes in
all other modules during LTO.

Joerg



More information about the llvm-dev mailing list