ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

Meta: Make the "Release" build type use -O3 and -flto

Open gmta opened this issue 9 months ago • 3 comments

This doesn't affect the default preset, but the Distribution preset will now compile with these flags instead.

gmta avatar Mar 26 '25 13:03 gmta

The "right away" to LTO is with https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html and https://cmake.org/cmake/help/latest/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html / https://cmake.org/cmake/help/latest/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.html

I believe we use the pattern in Serenity's Kernel?

Should we enable lto for the static libraries from vcpkg as well?

ADKaster avatar Mar 27 '25 23:03 ADKaster

The "right away" to LTO is with https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html and https://cmake.org/cmake/help/latest/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html / https://cmake.org/cmake/help/latest/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.html

Oh nice, updated!

Should we enable lto for the static libraries from vcpkg as well?

I end up with a lot of errors like these when building dav1d if I do that:

<instantiation>:21:9: error: unknown directive
        .func _dav1d_ipred_dc_128_8bpc_neon
        ^
../src/1.5.0-c16881aeb7.clean/src/arm/64/ipred.S:35:1: note: while in macro instantiation
function ipred_dc_128_8bpc_neon, export=1
^

gmta avatar Mar 28 '25 00:03 gmta

(FWIW, LTO is a much bigger win when combined with PGO. If you have just one of the two, PGO is a bigger win than LTO.)

nico avatar Mar 28 '25 00:03 nico