Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 3df6e4b6318d3acb18b2336eec5340c47aa510b5 Mon Sep 17 00:00:00 2001
- From: Sultan Alsawaf <sultan@kerneltoast.com>
- Date: Tue, 12 May 2020 12:00:08 -0700
- Subject: [PATCH] kbuild: Increase GCC automatic inline instruction limit to
- 1000 for LTO
- GCC 10 updated its interprocedural optimizer's logic to have it make
- more conservative inlining decisions, resulting in worse syscall and
- hackbench performance compared to GCC 9. Although the max-inline-insns-
- auto parameter's value was not altered, increasing it from the -O3
- default of 30 to 1000 instructions yields improved performance with LTO,
- surpassing GCC 9.
- Do this only for LTO though because for non-LTO builds, this causes GCC
- to produce mountains of spurious -Wmaybe-used-uninitialized warnings.
- Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
- ---
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/Makefile b/Makefile
- index de5047ed12dd..9ea681432d77 100644
- --- a/Makefile
- +++ b/Makefile
- @@ -638,7 +638,7 @@ endif
- ifdef CONFIG_LTO
- LTO_CFLAGS := -flto -flto=jobserver -fno-fat-lto-objects \
- -fuse-linker-plugin -fwhole-program
- -KBUILD_CFLAGS += $(LTO_CFLAGS)
- +KBUILD_CFLAGS += $(LTO_CFLAGS) --param=max-inline-insns-auto=1000
- LTO_LDFLAGS := $(LTO_CFLAGS) -Wno-lto-type-mismatch -Wno-psabi \
- -Wno-stringop-overflow -flinker-output=nolto-rel
- LDFINAL := $(CONFIG_SHELL) $(srctree)/scripts/gcc-ld $(LTO_LDFLAGS)
Add Comment
Please, Sign In to add comment