[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything

Daniel Berlin dberlin at dberlin.org
Wed Nov 4 07:19:29 PST 2009


On Wed, Nov 4, 2009 at 4:51 AM, Hans Wennborg <hans at hanshq.net> wrote:

>
>
> The reason is that it is unsure whether the null pointer which is passed in
> the call to @foo may alias with %t. Obviously, a null pointer doesn't alias
> with anything, because it's not legal to read or write through it (right?).

I don't remember whether LLVM's language spec says anything different,
but whether null may alias anything is generally platform dependent.

On some platforms, null may actually point to things and be
dereferenced legally.

(This is often used to speculatively executive conditionals involving
pointer-derefs)



More information about the llvm-dev mailing list