cmd/compile: model stack ABI values with preallocated and goret - #126
Draft
zhouguangyuan0718 wants to merge 8 commits into
Draft
cmd/compile: model stack ABI values with preallocated and goret#126zhouguangyuan0718 wants to merge 8 commits into
zhouguangyuan0718 wants to merge 8 commits into
Conversation
zhouguangyuan0718
force-pushed
the
codex/go-stack-byval
branch
3 times, most recently
from
August 13, 2026 04:12
391a633 to
ba11337
Compare
zhouguangyuan0718
force-pushed
the
codex/go-stack-byval
branch
from
August 15, 2026 14:07
ba11337 to
21a31ae
Compare
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.
LLVM-PR: goallc/llvm-project#70
Depends on goallc/llvm-project#70 at head
5f9499711cfd85c7d0fb64e9cf4b75fb1573682d.Summary
preallocated(T)parameters and call operand bundles for values wholly assigned to the incoming stackgoret(T) "goretindex"="N"carriers for stack results while preserving compact LLVM returns for register resultsgo_memory_resultslist; each result carrier records its own logical index with an ordinary key/value parameter attributearchive/zip,compress/flate,compress/gzip, andcompress/zlibin the standard-library LLVM whitelistThis deliberately does not use
sret: Go supports multiple mixed register/stack results.ARM64 external-link regression
The carrier lowering allowed the AArch64 scheduler to separate an
ADRPand its laterLDR. GoObj correctly represented these as independentR_ARM64_PCRELrelocations, but the Go external linker resolved each relocation against its preliminary data layout. The system linker then moved the target data section, leaving the load pointed at the old address and makingfixedbugs/issue34968.gofault in_cgo_cmalloc.The linker now identifies each affected ARM64 instruction and emits the corresponding ELF
ADR_PREL_PG_HI21/ADD_ABS_LO12_NC/LDST*_ABS_LO12_NCor Mach-OPAGE21/PAGEOFF12relocation. Windows keeps the existing PE resolution path. Unsupported instructions fail closed.Joint validation
src/make.bash: PASSsrc/make.bash: PASScmd/compile/internal/ssawithllvm23,dynamicllvm: PASScmd/llvmtoolexectests: PASScmd/link/internal/arm64,ld, andloader: PASSissue34968,issue36705, andissue47227: 10 consecutive focused policy PASS after the full rebuildissue34968: 10 consecutive focused policy PASS; a separately forced-linkmode=externalbinary also ran 10/10default<O2>: PASScompress/flatecurrent-package tests with native dependencies atdefault<O2>: 3 consecutive PASScompress/flateraw IR, optimized IR, GoObj, and executable evidence containspreallocatedcarriers and no Go-specificbyvaltemporary pathreflect.Value.callIR that exposed the large-result statepoint path lowers throughllcand produces a Go objectmath.Abslowering is checked as Go's sign-bit clear; its O2 form and the arm64 lowering are checked asllvm.fabsThe new Linux amd64/arm64 joint qualification must select the exact LLVM #70 payload and pass before this draft is ready.