[llvm] [DataLayout] Add isNullPointerAllZeroes (PR #165314)
Robert Imschweiler via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 28 03:48:03 PDT 2025
ro-i wrote:
> Only introducing a DataLayout method for this creates the incorrect impression that non-zero null pointers are supported by LLVM.
I see, makes sense.
> Though I'm not sure doing this at this point is really useful.
I think @arichardson's original point (https://github.com/llvm/llvm-project/pull/140802#discussion_r2466373958) was that we shouldn't introduce additional hardcoded `AS == 0` changes in the code because they should be adapted as soon as we have a proper way to tell if null is 0.
On the other hand, null being 0 shouldn't be assumed anymore, either, ig. Because that would need to be changed, too, as soon as this gets changed.
So, either https://github.com/llvm/llvm-project/pull/140802 has to wait or we introduce `bool isNullPointerAllZeroes(unsigned AS) { return true; }` as you suggested so that there is only one location that needs to be changed in the future.
https://github.com/llvm/llvm-project/pull/165314
More information about the llvm-commits
mailing list