<div dir="ltr"><div dir="ltr"><div>Hi llvm-dev@,</div><div><br></div><div>It recently transpired that LLVM doesn't correctly preserve debugging information when null pointer constants are assigned to variables [0], with the debug records getting dropped by SelectionDAG. Fixing that [1] raises a few questions about the bit-value of null in different address spaces, so I'd like to ask:</div><div> * Can we just assume that null is zero-valued for all address spaces?<br></div><div> * If not, are there APIs available for determining an address spaces' null-value?</div><div><br></div><div>What's permissible / disallowed for address spaces is unclear to me. Various comments around the code base suggest that nullptr is always zero for address space zero; I'm not aware of rules for other address spaces. Without further information, the current solution is to have non-zero address space nulls marked as "optimized out".</div><div><br></div><div>[0] <a href="https://bugs.llvm.org/show_bug.cgi?id=39787">https://bugs.llvm.org/show_bug.cgi?id=39787</a></div><div>[1] <a href="https://reviews.llvm.org/D55227">https://reviews.llvm.org/D55227</a></div><div><br></div><div>--</div><div>Thanks,</div><div>Jeremy</div><div><br></div></div></div>