[llvm-dev] RFC: New function attribute HasInaccessibleState

James Y Knight via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 4 11:09:37 PST 2015

On Dec 4, 2015, at 12:42 PM, Hal Finkel via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>>> In the case of user-defined allocation functions, the definitions
>>>> for those functions are available
>>> Are they? probably not unless you're in an LTO build.
>> Yes, I'm assuming an LTO build.
> The concerns around LTO here, while legitimate, apply only to a very-specific kind of LTO: An LTO which includes the definitions of the libc. This is actually quite tricky to support, semantically, and already breaks our malloc aliasing assumptions. There are many legitimate uses of LLVM, both for statically-compiled code and for JIT'd code, that depend on a visibility boundary between certain core runtime services and the user code being compiled to provide for effective optimization.

Don't a lot of people use not-shipped-with-libc malloc/free replacements? While LTO'ing your program with libc itself would seem unlikely, I don't think LTO'ing a program along with a malloc replacement is that unusual. (Either with a fully custom malloc or with something like tcmalloc).

More information about the llvm-dev mailing list