[all-commits] [llvm/llvm-project] 757673: [TargetLowering] Add a new function `getNullPtrValue`
Shilei Tian via All-commits
all-commits at lists.llvm.org
Mon Feb 10 20:59:34 PST 2025
Branch: refs/heads/users/shiltian/non-zero-null-ptr
Home: https://github.com/llvm/llvm-project
Commit: 7576732d3e2d3d8cca9203ea033a208872eaa5b6
https://github.com/llvm/llvm-project/commit/7576732d3e2d3d8cca9203ea033a208872eaa5b6
Author: Shilei Tian <i at tianshilei.me>
Date: 2025-02-10 (Mon, 10 Feb 2025)
Changed paths:
M llvm/include/llvm/CodeGen/TargetLowering.h
M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
M llvm/test/CodeGen/AMDGPU/agpr-copy-no-free-registers.ll
M llvm/test/CodeGen/AMDGPU/blender-no-live-segment-at-def-implicit-def.ll
M llvm/test/CodeGen/AMDGPU/branch-folding-implicit-def-subreg.ll
M llvm/test/CodeGen/AMDGPU/cf-loop-on-constant.ll
M llvm/test/CodeGen/AMDGPU/chain-hi-to-lo.ll
M llvm/test/CodeGen/AMDGPU/collapse-endcf.ll
M llvm/test/CodeGen/AMDGPU/exec-mask-opt-cannot-create-empty-or-backward-segment.ll
M llvm/test/CodeGen/AMDGPU/hazard-recognizer-src-shared-base.ll
M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.set.inactive.ll
M llvm/test/CodeGen/AMDGPU/load-hi16.ll
M llvm/test/CodeGen/AMDGPU/load-lo16.ll
M llvm/test/CodeGen/AMDGPU/machine-sink-loop-var-out-of-divergent-loop-swdev407790.ll
A llvm/test/CodeGen/AMDGPU/nullptr-lowering.ll
M llvm/test/CodeGen/AMDGPU/promote-constOffset-to-imm.ll
M llvm/test/CodeGen/AMDGPU/sdwa-peephole-instr-combine-sel.ll
M llvm/test/CodeGen/AMDGPU/setcc-multiple-use.ll
M llvm/test/CodeGen/AMDGPU/stacksave_stackrestore.ll
M llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.convergencetokens.ll
M llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.ll
M llvm/test/CodeGen/AMDGPU/tail-call-uniform-target-in-vgprs-issue110930.convergencetokens.ll
M llvm/test/CodeGen/AMDGPU/tail-call-uniform-target-in-vgprs-issue110930.ll
M llvm/test/CodeGen/AMDGPU/tuple-allocation-failure.ll
M llvm/test/CodeGen/AMDGPU/unstructured-cfg-def-use-issue.ll
M llvm/test/CodeGen/AMDGPU/v_cmp_gfx11.ll
M llvm/test/CodeGen/AMDGPU/waterfall_kills_scc.ll
M llvm/test/CodeGen/AMDGPU/wqm.ll
Log Message:
-----------
[TargetLowering] Add a new function `getNullPtrValue`
In most cases, `nullptr` is a zero-value constant with the corresponding pointer
type. However, this is not always the case. For example, AMDGPU uses
`0xffffffff` as nullptr for AS3 and AS5, leading to lowering issues. Currently,
to ensure correct lowering, `ptr addrspace(5) null` must be written as
`addrspacecast (ptr null to ptr addrspace(5))`.
This PR introduces `TargetLowering::getNullPtrValue` to determine the correct
value of `nullptr`. This helps with proper lowering of `ConstantPointerNull`,
which already has the correct address space.
Fixes #115083.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list