[NFCI] Use DataLayout::getNullPtrValue in codegen and analysis paths - #183210
Draft
shiltian wants to merge 1 commit into
Draft
[NFCI] Use DataLayout::getNullPtrValue in codegen and analysis paths#183210shiltian wants to merge 1 commit into
DataLayout::getNullPtrValue in codegen and analysis paths#183210shiltian wants to merge 1 commit into
Conversation
Replace hardcoded 0 for null pointer materialization with `DataLayout::getNullPtrValue(AS)` across codegen, analysis, and transform paths. This prepares these paths for a future semantic change where `ConstantPointerNull` may represent a non-zero null pointer value on certain targets. NFC because all address spaces currently have all-zero null pointer values, so `getNullPtrValue` returns 0 for every address space.
This was referenced Feb 24, 2026
Contributor
Author
This was referenced Feb 24, 2026
Contributor
Author
|
Don't review this PR in its own. Check #183215 for more context. |
🪟 Windows x64 Test Results
Failed Tests(click on a test name to see its output) LLVMLLVM.CodeGen/AArch64/arm64-collect-loh-garbage-crash.llLLVM.CodeGen/AArch64/arm64-collect-loh-str.llLLVM.CodeGen/AArch64/arm64_32-atomics.llLLVM.CodeGen/AArch64/arm64_32-fastisel.llLLVM.CodeGen/AArch64/arm64_32-null.llLLVM.CodeGen/AArch64/arm64_32-stack-pointers.llLLVM.CodeGen/AArch64/arm64_32-va.llLLVM.CodeGen/AArch64/arm64_32.llLLVM.CodeGen/AArch64/swifterror.llIf these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Replace hardcoded 0 for null pointer materialization with
DataLayout::getNullPtrValue(AS)across codegen, analysis, andtransform paths. This prepares these paths for a future semantic
change where
ConstantPointerNullmay represent a non-zero nullpointer value on certain targets.
NFC because all address spaces currently have all-zero null pointer
values, so
getNullPtrValuereturns 0 for every address space.