build: preserve DebugRefs during SSA order repairs#2146
Closed
cpunion wants to merge 2 commits into
Closed
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
cpunion
force-pushed
the
codex/dwarf-debugref-return-order
branch
from
July 22, 2026 09:35
84c513f to
d08e0e4
Compare
cpunion
marked this pull request as ready for review
July 22, 2026 14:11
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Collaborator
Author
|
Consolidated into #2143, which now contains the SSA DebugRef order-repair changes and their regression coverage. Closing this redundant PR; no code is being merged to main by this action. |
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.
Problem
LLGo repairs Go SSA evaluation order in two places: return values whose storage is mutated by a later call, and assignment targets for single-case select receives. With
ssa.GlobalDebug,ssa.DebugRefmetadata also uses the affected values. Treating those metadata uses as executable dependencies blocks both otherwise-safe repairs.That makes enabling DWARF change program behavior:
crypto/x509.ParseOIDcan return a stale OID because its result load stays before the mutating call.[100 1]instead of[1 100].Changes
ssa.DebugRefusers as one stable group after the mutating callssa.DebugRefusers together with single-case select assignment-target dependencies after the receiveThe change is confined to the existing SSA order-repair module. It does not alter the loader, DWARF encoding, C ABI lowering, or LLVM optimization pipeline.
Fixes #2122.
Verification
ssa.GlobalDebugssa.GlobalDebugcrypto/x509.ParseOIDSSA regressionTestSingleCaseSelectReceiveAssignOrderacceptance with-w=falseon macOS and Ubuntu arm64crypto/x509 TestOIDwith-w=falseon macOS and Ubuntu arm64internal/buildpackage on macOS