cmake: Enable LTO for rpcs3_emu target#16692
Merged
Merged
Conversation
- Provides a small speedup and saves some space in the binary.
Whatcookie
marked this pull request as draft
February 11, 2025 05:21
Contributor
|
Clang CI build ran fine for me under linux. |
|
From the screenshots difference in that Ninja Gaiden game is about 22fps, which is ~15%! That is certainly more than a humble "small speedup". |
Whatcookie
marked this pull request as ready for review
February 11, 2025 17:32
Member
Author
|
Both the GCC and Clang CI builds seem fine, so I unmarked it as draft. |
Contributor
|
Possibly limit it to RSX projects? what is the toll on compilation time? |
Member
Author
It adds less than a minute of time on my local builds. It's hard to tell what the impact is on the CI since the CI seems to have a large run to run variance to begin with. It'd be nice to have LTO for more than just the RSX files since the PPU/SPU compilation is also noticeably faster. |
Contributor
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.

In the past, enabling LTO across the entire program would cause some crashes. With GCC, LLVM would crash when compiling programs, and with clang, QT would crash. Let's try just enabling LTO for the rpcs3_emu target, instead of all the code of RPCS3.
Provides a small speedup (for linux users in titles not limited by SPU or PPU performance) and saves some space in the binary.
Before:

After:

Let's leave it as a draft until we can confirm the CI builds run crash free.