[llvm] [WIP] Extend data layout to add non zero null value for address space. (PR #83109)

David Chisnall via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 08:52:53 PST 2024


davidchisnall wrote:

I can't really review this function without a doc comment explaining what it's meant to be. Presumably most address spaces have multiple non-zero values, why do we have a function that returns one of them?

I believe the functions should be for requesting the integer value of a canonical null value, not a specific non-zero value.

I remain unconvinced that this is a viable approach for platforms where zero is a valid address.  C requires that *any* integer constant expression that evaluates to zero be implicitly convertable to a null pointer.  That assumption in C has leaked into LLVM IR in a lot of places.  I'd love to have them all fixed but even identifying them all is probably a multi-year effort (and preventing people from adding more is even harder).  

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


More information about the llvm-commits mailing list