[llvm] [RFC][DataLayout] Add null pointer value infrastructure (PR #183207)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 14:49:46 PDT 2026


shiltian wrote:

> It's my understanding that the reason why we have the non-AS0 special case for null pointer dereferenceability is just that the null pointer is currently wrong for non-AS0 address spaces on some targets. Once that is fixed, I don't think there is a reason to retain the AS0 distinction, or have a separate opt-in for this.

I'm not sure about the history, but I tend to feel that it is because null pointer is zero value, so we can't assume anything about it. After the entire semantic changes, null pointer literally represents an invalid pointer.

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


More information about the llvm-commits mailing list