[PATCH] D26196: AMDGPU: Translate null pointers in private and local addr space

Tom Stellard via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 09:03:25 PDT 2016


tstellarAMD added a comment.

In https://reviews.llvm.org/D26196#586723, @Anastasia wrote:

> My understanding of NULL constant in IR was that it doesn't assume any specific integer value (i.e. 0). And currently as I can see it is lowered very late in LLVM backend  during the code selection phase.


It is assumed to be zero in some places.  For example:
https://github.com/llvm-mirror/llvm/blob/master/lib/IR/ConstantFold.cpp#L620
https://github.com/llvm-mirror/llvm/blob/master/lib/Analysis/ValueTracking.cpp#L1512

-Tom


https://reviews.llvm.org/D26196





More information about the cfe-commits mailing list