Skip to content

[Win] Add opt-in Release size optimization - #8803

Draft
Alex Sepkowski (alsepkow) wants to merge 1 commit into
microsoft:mainfrom
alsepkow:user/alsepkow/add-release-size-option
Draft

[Win] Add opt-in Release size optimization#8803
Alex Sepkowski (alsepkow) wants to merge 1 commit into
microsoft:mainfrom
alsepkow:user/alsepkow/add-release-size-option

Conversation

@alsepkow

Copy link
Copy Markdown
Contributor

Add an opt-in size policy for Windows Release builds.

  • Add DXC_OPTIMIZE_FOR_SIZE, defaulting to OFF, so existing developer and CI builds keep their current throughput-oriented behavior.
  • Add /Os to C and C++ Release flags when the option is enabled.
  • Keep this as a focused CMake option rather than introducing an OfficialRelease.cmake preset; distribution pipelines can opt in without coupling unrelated release policy.

Testing:

  • Configured an x64 build with Visual Studio 18 2026 and DXC_OPTIMIZE_FOR_SIZE=ON.
  • Verified the generated Release llvm-tblgen.vcxproj contains <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>.
  • Built the Release llvm-tblgen target successfully.

This is a draft because the binary-size benefit should be weighed against DXC throughput before enabling it in a shipping pipeline. No release note is needed because the option is disabled by default and changes build configuration rather than compiler-visible behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0f4d0e10-e926-4bce-b36b-0abebc08f6dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant