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

Shilei Tian via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 24 20:01:54 PST 2026


shiltian wrote:

> I wonder, would this (perhaps with additional work?) eventually allow Wasm's `ref.null` for `externref` and `funcref` to be lowered from this new `nullptr`, rather than requiring an intrinsic call.
> 
> Wasm uses non-integral address spaces to represent `externref` and `funcref`. But this PR just seems to impact the integer null value of integral pointers?

I'm not familiar with WASM, but the ideal here is, the `ConstantPointerNull` will represent a real `nullptr`, and its value can only be `0` or `~0U`. The previous attempt did allow an arbitrary value, but eventually is not included because LLVM doesn't have the infrastructure to support that anyway. Given that, it doesn't seem to be able to represent a `nullptr` in WASM.

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


More information about the llvm-branch-commits mailing list