Skip to content

[Win] Enable function-level linking for Release - #8802

Merged
Alex Sepkowski (alsepkow) merged 2 commits into
microsoft:mainfrom
alsepkow:user/alsepkow/enable-release-function-sections
Sep 3, 2026
Merged

[Win] Enable function-level linking for Release#8802
Alex Sepkowski (alsepkow) merged 2 commits into
microsoft:mainfrom
alsepkow:user/alsepkow/enable-release-function-sections

Conversation

@alsepkow

@alsepkow Alex Sepkowski (alsepkow) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

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.

  • Add /Gy to the C and C++ Release flags so the existing /OPT:REF linker setting can discard individual unused functions from referenced object files.
  • Resolve the long-standing MSVC dead-strip FIXME in HandleLLVMOptions.cmake.

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
@alsepkow
Alex Sepkowski (alsepkow) marked this pull request as ready for review September 2, 2026 23:41
Copilot AI balanced review requested due to automatic review settings September 2, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 /Gy to 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.

@damyanp Damyan Pepper (damyanp) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM although:

  • did you check what the upstream version of this file looks like these days?
  • shoudl this have hlsl change begin/end markers?

Comment thread cmake/modules/HandleLLVMOptions.cmake
Co-authored-by: Chris B <beanz@abolishcrlf.org>
Copilot AI review requested due to automatic review settings September 3, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused build-configuration change correctly implements the stated optimization.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@alsepkow
Alex Sepkowski (alsepkow) merged commit 2df48e8 into microsoft:main Sep 3, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants