Kernel: Enable LTO for kernel_heap if ENABLE_KERNEL_LTO is set

By enabling LTO for the kernel_heap object too, we open the door for
optimization opportunities that come from (partially) inlining `::new`
or kmalloc. Every software spends a non-trivial amount of its run time
on allocating memory, so hopefully this change will make LTO builds even
faster.
This commit is contained in:
Daniel Bertalan 2021-09-21 22:59:03 +02:00 committed by Linus Groh
parent 06fc64be13
commit 10c3cf9a47

View file

@ -496,6 +496,9 @@ if (ENABLE_KERNEL_LTO)
check_ipo_supported()
add_definitions(-DENABLE_KERNEL_LTO)
set_property(TARGET Kernel PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
if (NOT "${SERENITY_ARCH}" STREQUAL "aarch64")
set_property(TARGET kernel_heap PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
if (NOT "${SERENITY_ARCH}" STREQUAL "aarch64")