compiler: add standalone locality directive analysis#2084
Closed
cpunion wants to merge 1 commit into
Closed
Conversation
This was referenced Jul 13, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cpunion
force-pushed
the
codex/locality-analysis
branch
from
July 14, 2026 11:27
a260f03 to
4373348
Compare
Collaborator
Author
|
Closing in favor of #2079. The directive parsing and locality source analysis remain part of the single TLS/GLS implementation PR so the feature can be reviewed and merged as one coherent change. |
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
Add a standalone source-analysis layer for LLGo package-variable locality directives.
internal/directivenormalizesgo:*,llgo:*, and//exportcomments without assigning feature semantics.internal/localitydefines the TLS/GLS source model, validates directive placement, groups variables by Go initialization unit, and prepares replayable initializer helpers.This is a reviewable prerequisite for #2079. It intentionally does not connect the directives to the compiler pipeline or change generated code by itself; #2079 owns metadata integration, caching, lowering, runtime storage, and end-to-end tests.
Proposal: #2077
Why split this out
The previous #2079 diff mixed generic directive parsing, source semantics, compiler state, LLVM lowering, and runtime storage. Keeping source analysis in one independent package gives the compiler a small API and avoids moving unrelated
go:*/llgo:*handling into a locality-specific implementation.Semantics covered
//llgo:tlsand//llgo:glsdeclarations;go:embedcombinations;Tests
Run with
GOMAXPROCS=2,GOMEMLIMIT=2GiB,GOFLAGS=-p=1, and a 15 GiB process-tree watchdog:The commit was also checked out in an isolated worktree and passed independently of the remaining #2079 stack.