Skip to content

Add LTCG linker flag for optimization - #310

Merged
nrspruit merged 3 commits into
oneapi-src:masterfrom
nrspruit:add_ltcg_linker_flag
Apr 1, 2025
Merged

nrspruit merged 3 commits into
oneapi-src:masterfrom
nrspruit:add_ltcg_linker_flag

Conversation

@nrspruit

@nrspruit nrspruit commented Apr 1, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
@nrspruit
nrspruit force-pushed the add_ltcg_linker_flag branch from 8eaef76 to 42127a7 Compare April 1, 2025 18:01

@leonardo-intel leonardo-intel 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.

This morning we had a meeting regarding this flag and it was discussed that setting /LTCG:incremental disables whole program optimization. Also, the binskim output recommends to use /LTCG along with WholeProgramOptimization (/GL).

C:\Users\callumso\dev\npu-driver\build\x64\level_zero\src\level_zero-build\bin\Release\ze_loader.dll: warning BA6006: 'ze_loader.dll' was compiled without Link Time Code Generation (/LTCG). Enabling LTCG can improve optimizations and performance.
For VC projects use WholeProgramOptimization property with 'true' value.

so can you update the PR to not set LTCG with incremental linking, and to also enable WholeProgramOptimization
So the linker flags should be:
/LTCG
/GL

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
@nrspruit
nrspruit marked this pull request as ready for review April 1, 2025 19:55
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
@nrspruit
nrspruit merged commit 9851ce3 into oneapi-src:master Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants