Makefile: Use -O3 optimization for CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE

-O3 is much more stable with modern compilers these days than it was a
decade ago. Using -O3 on the kernel results in significantly improved
hackbench performance, which is a sign that overall performance in the
kernel is improved. It works especially well in conjunction with LTO.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
urubino
Sultan Alsawaf 3 years ago committed by Jenna-they-them
parent 8a0e312a2c
commit 56c6a46084
  1. 2
      Makefile

@ -720,7 +720,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
else
KBUILD_CFLAGS += -O2
KBUILD_CFLAGS += -O3
endif
# Tell gcc to never replace conditional load with a non-conditional one

Loading…
Cancel
Save