[llvm] [WIP] Extend data layout to add sentinel pointer value for address space. (PR #83109)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 02:56:32 PDT 2024


================
@@ -164,6 +165,8 @@ class DataLayout {
   /// well-defined bitwise representation.
   SmallVector<unsigned, 8> NonIntegralAddressSpaces;
 
+  DenseMap<uint64_t, uint64_t> AddrSpaceToNonZeroValueMap;
----------------
arsenm wrote:

Unless we can start folding out expressions based on inttoptr, changing the lowering of inttoptr/ptrtoint only causes more problems. We do not have a correctness representational problem today (modulo bugs).

We have an optimization issue, because we end up with cases like #58617 where obviously false pointer comparisons can't be deleted. The IR needs to be aware of the non-0 behavior, rather than just ignoring it for globals/functions/nonnull decorated pointers 

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


More information about the llvm-commits mailing list