[llvm] [WIP][IR][Constants] Change the semantic of `ConstantPointerNull` to represent an actual `nullptr` instead of a zero-value pointer (PR #166667)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 11:20:20 PST 2025


================
@@ -193,9 +193,11 @@ constexpr DataLayout::PrimitiveSpec DefaultVectorSpecs[] = {
 };
 
 // Default pointer type specifications.
-constexpr DataLayout::PointerSpec DefaultPointerSpecs[] = {
+const DataLayout::PointerSpec DefaultPointerSpecs[] = {
----------------
arichardson wrote:

We could avoid the need for a global ctor/dtor if we just stored a plain integer value? Since we only support 0/-1 we could just rely on sign-extension? But of course that makes the getter slower so probably best to ignore this suggestion.

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


More information about the llvm-commits mailing list