[LLVMdev] [llvm-commits] [llvm] r166875 - in /llvm/trunk: lib/Transforms/Scalar/LoopIdiomRecognize.cpp test/Transforms/LoopIdiom/basic.ll

Benjamin Kramer benny.kra at gmail.com
Sat Oct 27 13:32:53 PDT 2012


On 27.10.2012, at 18:24, Benjamin Kramer <benny.kra at gmail.com> wrote:

> 
> On 27.10.2012, at 18:15, Sean Silva <silvas at purdue.edu> wrote:
> 
>> How does this affect freestanding implementations?
> 
> This transform is disabled with -fno-builtin or -ffreestanding.

Thinking a bit more about this, it looks like the way -ffreestanding is implemented in clang is too conservative. Currently -ffreestanding disables optimizing all builtin functions, just like -fno-builtin. However, the GCC manual says:

> GCC requires the freestanding environment provide memcpy,memmove, memset and memcmp.

Should we enable those functions selectively in a freestanding environment? LLVM will start optimizing calls to them, and turn loops into one of those functions if possible. I'm not sure if that behavior is acceptable with -ffreestanding.

- Ben



More information about the llvm-dev mailing list