cmd/compile: expand LLVM nil checks after IR construction - #38
Merged
zhouguangyuan0718 merged 1 commit intoAug 2, 2026
Merged
Conversation
zhouguangyuan0718
force-pushed
the
codex/llvm-nilcheck-intrinsic-expand
branch
from
August 2, 2026 01:34
a53f48c to
b703e7a
Compare
zhouguangyuan0718
force-pushed
the
codex/llvm-nilcheck-intrinsic-expand
branch
from
August 2, 2026 01:45
b703e7a to
85bbe83
Compare
This was referenced Aug 2, 2026
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.
Summary
llvm.goallc.nilcheckas a temporary semantic marker during SSA-to-LLVM value loweringFinishPhi()pathruntime.panicmemcallValue.ReplaceIncomingBlockBlockEndsCFG bypass entirelyThe marker is deleted before LLVM verification, optimization, statepoint rewriting, or IR emission.
Uses merged goallc/go-llvm#5 at
v0.0.0-20260802014221-e0a85f0a18bc(master@e0a85f0a18bc).Validation
src/make.bashgo mod verify;go list -mod=vendor github.com/goallc/go-llvmgo test -tags="llvm23 dynamicllvm" -count=1 cmd/compile/internal/ssa cmd/llvmtoolexecllvm.goallc.nilcheckopt -load-pass-plugin=... -passes=verifyllc -load-pass-plugin=... -verify-machineinstrs -filetype=objpanicmemsafepoint map and separate stack-growth mapgofmt;go mod tidy;go mod vendor;git diff --checkExisting boundary
The aggregate
Test/LLVMcommand still reports the pre-existingabi-differential/mixedABIpointer-map count mismatch. The nilcheck fixture and changed lowering do not participate in that ABI case; codegen, runtime, alloca/statepoint, and fail-closed groups otherwise pass.