diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2021-09-21 22:59:03 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-17 17:09:58 +0100 |
commit | 10c3cf9a47f928075563abd89c01b5de9f24e807 (patch) | |
tree | ad34eccc922ea6248526eda6979ff2e44008e0d3 | |
parent | 06fc64be13d933a47232243732dc8ca8313374ed (diff) | |
download | serenity-10c3cf9a47f928075563abd89c01b5de9f24e807.zip |
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.
-rw-r--r-- | Kernel/CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 4af539332f..5468444533 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -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") |