[llvm] [DataLayout] Add isNullPointerAllZeroes (PR #165314)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 14:32:53 PDT 2025


nikic wrote:

> > The null pointer (as in ptr null) is always all-zeroes, no matter the address space.
> 
> Isn't that what's being discussed [here](https://discourse.llvm.org/t/rfc-introduce-sentinel-pointer-value-to-datalayout/85265/17) / in #131557?

It is. Making `null` not be the all-zeroes value in all address spaces is a proposed change, but implementing that takes a lot more than adding one DataLayout method. The status quo is that null is always the all-zeroes value.

(The only thing that's easy to do is allow specifying that null in certain address spaces is non-dereferenceable. But I don't think that's what you are trying to do?)

https://github.com/llvm/llvm-project/pull/165314


More information about the llvm-commits mailing list