Skip to content

cmd/llvmplugin: describe pointer allocas as memory roots - #33

Merged
zhouguangyuan0718 merged 1 commit into
go1.27.masterfrom
codex/alloca-statepoint-mutation-correctness
Aug 1, 2026
Merged

cmd/llvmplugin: describe pointer allocas as memory roots#33
zhouguangyuan0718 merged 1 commit into
go1.27.masterfrom
codex/alloca-statepoint-mutation-correctness

Conversation

@zhouguangyuan0718

Copy link
Copy Markdown

Summary

  • replace pointer-alloca preload, gc-live, gc.relocate, and post-call write-back with a deopt pointer-map record
  • enumerate supported fixed allocas into whole-object 64-bit slot bitmaps
  • preserve existing deopt operands and ordinary SSA gc-live relocation
  • keep writable callees authoritative over alloca memory, avoiding stale pointer restoration
  • fail closed for dynamic, realigned, vector, non-entry, ambiguous select/PHI, volatile, atomic, and otherwise unstable allocas
  • update the GoObj stack-map bridge, documentation, IR tests, malformed-contract tests, GoObj checks, and runtime GC/stack-growth fixture

Depends on goallc/llvm-project#18.

Validation

  • GoALLC plugin CTest: 45/45 passed
  • cmd/internal/testdir LLVM alloca-statepoint and runtime fixture passed
  • ArgsPointerMaps, LocalsPointerMaps, PCDATA stack-map indexes, and frame offsets verified
  • opt default O2 and llc verify-machineinstrs passed
  • AArch64 wbZero/wbMove fixture produces no stale post-call store and no added root spill
  • fresh-cache runtime GC and stack-growth executable passed

This is an independent replacement for the old fixed-home alloca model. It intentionally does not include the capture-analysis, readonly-special-case, or fake.use workaround from PR #32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant