[llvm-dev] RFC: New function attribute HasInaccessibleState

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 4 09:42:05 PST 2015

----- Original Message ----- 
> From: "Vaivaswatha Nagaraj via llvm-dev" <llvm-dev at lists.llvm.org>
> To: "Krzysztof Parzyszek" <kparzysz at codeaurora.org>
> Cc: "LLVM Dev" <llvm-dev at lists.llvm.org>
> Sent: Friday, December 4, 2015 11:21:03 AM
> Subject: Re: [llvm-dev] RFC: New function attribute
> HasInaccessibleState

> >> 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.

So, yes, this will break LTO when you include libc itself in the optimization process. We already don't support this (we'd need, at least, to adjust our malloc noalias assumptions, if not many other things). I don't think this is a major concern.

I think we need to go back and look at the underlying use case (as I understand it): GlobalAA should be able to figure out that calls to malloc/free don't touch global variables visible to the optimizer. How do we address this problem?

Thanks again,


> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory

More information about the llvm-dev mailing list