arter97

gcc-10 inliner change

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