[Win] Enable function-level linking for Release - #8802
Merged
Alex Sepkowski (alsepkow) merged 2 commits intoSep 3, 2026
Merged
Conversation
Compile C and C++ Release functions into individual COMDATs so the existing /OPT:REF linker setting can discard unused functions from referenced object files. This resolves the long-standing MSVC dead-strip FIXME. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0f4d0e10-e926-4bce-b36b-0abebc08f6dc
Alex Sepkowski (alsepkow)
marked this pull request as ready for review
September 2, 2026 23:41
Copilot started reviewing on behalf of
Alex Sepkowski (alsepkow)
September 2, 2026 23:41
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused build-configuration change is consistent with existing /OPT:REF settings and has appropriate manual verification.
Pull request overview
Enables function-level dead-code elimination for Windows Release builds.
Changes:
- Adds
/Gyto Release C and C++ flags. - Removes the resolved MSVC dead-strip FIXME.
File summaries
| File | Description |
|---|---|
cmake/modules/HandleLLVMOptions.cmake |
Enables function-level linking for MSVC Release builds. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Damyan Pepper (damyanp)
approved these changes
Sep 3, 2026
Damyan Pepper (damyanp)
left a comment
Member
There was a problem hiding this comment.
LGTM although:
- did you check what the upstream version of this file looks like these days?
- shoudl this have hlsl change begin/end markers?
Farzon Lotfi (farzonl)
approved these changes
Sep 3, 2026
Chris B (llvm-beanz)
approved these changes
Sep 3, 2026
Co-authored-by: Chris B <beanz@abolishcrlf.org>
Copilot started reviewing on behalf of
Alex Sepkowski (alsepkow)
September 3, 2026 20:26
View session
Ashley Coleman (V-FEXrt)
approved these changes
Sep 3, 2026
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.
Enable function-level dead-code elimination for Windows Release builds. This was previously enabled for our release builds via internal configuration. This is part of an effort to make the majority of our build configuration come directly from DXC.
/Gyto the C and C++ Release flags so the existing/OPT:REFlinker setting can discard individual unused functions from referenced object files.HandleLLVMOptions.cmake.