llvm: preserve GoObj marker relocs through inlining - #81
Merged
zhouguangyuan0718 merged 1 commit intoAug 5, 2026
Merged
Conversation
zhouguangyuan0718
changed the base branch from
codex/llvm-statepoint-duplicate-phi-edge
to
go1.27.master
August 5, 2026 08:23
zhouguangyuan0718
added a commit
that referenced
this pull request
Aug 15, 2026
This is the entry-argument-map and stack-growth layer of the remaining runtime LLVM support. PR #133 is merged. Stack: #136 (merged) -> #131 (merged) -> #132 (merged) -> #133 (merged) -> this PR -> #135. Implement the final entry-map and stack-growth contract agreed with LLVM #78: - every GoObj Go function keeps entry ArgsPointerMaps map 0 - entry and entry-depth PCDATA_StackMapIndex ranges use the native -1 sentinel - runtime stack-map lookup interprets that sentinel as entry map 0 - nosplit and systemstack are explicit function policies; the obsolete stack-growth statepoint attribute is removed - morestack remains a raw call, while LLVM decides from final frame size and leafness whether a split prologue is needed - GoObj derives entry map ranges from CFG state rather than a dedicated morestack marker The Machine StackMaps bridge remains Go-owned: `GoALLCStackMapPrinter` distinguishes the function-entry `STACKMAP` from ordinary statepoint records and passes their raw locations through `MCContext`; LLVM only provides generic metadata-printer dispatch and final GoObj serialization. Object-level `objview` checks cover entry PCDATA=-1, entry ArgsPointerMaps map 0, ordinary statepoint map 1, returning to entry depth, and the morestack map-0 path. The pinned payload is `goallc-llvm23.1.0-20260815T055258Z`, revision `ce1ede9c622755eeeb0ea695d5bffad3bac32dcc`, released after LLVM #81 merged. Validation after rebasing onto #133 merge `24581b9a69`: - coordinated Release+assertions X86/AArch64 LLVM build - 42 focused LLVM GoObj CodeGen tests - 91/91 plugin CTest with structured objview checks - prior joint `make.bash` and linux amd64/arm64 CI on the fallback payload - full `cmd/compile/internal/ssa` tests with LLVM enabled - ABI differential source and machine ArgsPointerMaps tests - caller-state and nosplit GoObj tests - statepoint codegen through LLVM O2 The stale LLVM `nowritebarrierrec` propagation test from the old stack was removed: finalized-IR enforcement remains the existing explicit TODO and is outside this entry-map PR. Supersedes the entry-argmap and stack-growth portion of #128.
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.sideeffectcalls before LLVM optimizationgoobj.marker_relocsfrom each marker's final containing function in the statepoint plugin, then remove the intrinsicllvm.compiler.usedThis fixes the O2 runtime failures in
fixedbugs/issue73888.goandfixedbugs/issue73888b.gowithout disabling LLVM inlining.Stacked on #80; it should be retargeted to
go1.27.masterafter #80 merges.Testing
ctest --test-dir src/cmd/llvmplugin/cmake-build-debug --output-on-failure(58/58)./bin/go test -tags=llvm23,dynamicllvm cmd/compile/internal/ssa -count=1fixedbugs/issue73888.go,fixedbugs/issue73888b.go