lto: analyze aggregate MethodByName string arguments#2159
Open
cpunion wants to merge 1 commit into
Open
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cpunion
force-pushed
the
codex/lto-aggregate-string-analysis
branch
from
July 23, 2026 02:12
5abb561 to
bbc6c11
Compare
43 tasks
20 tasks
cpunion
force-pushed
the
codex/lto-aggregate-string-analysis
branch
from
July 24, 2026 05:13
bbc6c11 to
f2fc976
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.
Unblocks #2143.
Problem
The MethodByName LTO pass assumed that every marked Go string argument had been lowered into separate
(ptr, len)parameters. LLGo's arm64 LP64 C ABI path can instead keep the 16-byte Go string as a{ptr, len}aggregate. In that form the pass could not recover direct, concatenated, sliced, or forwarded constant names, so it left the generic reflect marker in place and prevented the intended named-method pruning.Changes
runtime.StringCat,runtime.StringSlice2, and forwarded function parametersThe focused aggregate test generates frontend IR with automatic C ABI lowering disabled, applies LLGo's arm64 C ABI transformer, and runs the LTO pass. One module checks the four known-name markers without a generic value marker. A separate module checks conservative unknown-name fallback because a generic marker intentionally retains all matching methods and would invalidate an unused-method symbol assertion. The normal plugin runtime and symbol suites exercise the linked split-ABI path and verify that
Known.Dropis absent from the final binary.This PR changes analysis only; it does not change either ABI.
Validation
mainplugin at the missingConcatmarker and passes with this PRKnown.DropDev LTO GlobalDCE, both coverage platforms, and Codecov patch coverage pass