kbuild: Add support for LLVM's Polly optimizer
This adds support for compiling the kernel with optimizations offered by LLVM's polyhedral loop optimizer known as Polly, which can improve performance by improving cache locality in loops. Note that LLVM is not compiled with Polly by default -- it must be enabled explicitly. [ghostrider-reborn] - Removed polly DCE as it's no longer supported Signed-off-by: officialputuid <officialputuid@hack.id>
This commit is contained in:
10
Makefile
10
Makefile
@@ -765,6 +765,16 @@ else
|
||||
KBUILD_CFLAGS += -O3
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LLVM_POLLY
|
||||
KBUILD_CFLAGS += -mllvm -polly \
|
||||
-mllvm -polly-run-inliner \
|
||||
-mllvm -polly-opt-fusion=max \
|
||||
-mllvm -polly-ast-use-context \
|
||||
-mllvm -polly-detect-keep-going \
|
||||
-mllvm -polly-vectorizer=stripmine \
|
||||
-mllvm -polly-invariant-load-hoisting
|
||||
endif
|
||||
|
||||
# Tell gcc to never replace conditional load with a non-conditional one
|
||||
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
|
||||
|
||||
@@ -754,6 +754,14 @@ config SHADOW_CALL_STACK_VMAP
|
||||
provides better stack exhaustion protection, but increases per-thread
|
||||
memory consumption as a full page is allocated for each shadow stack.
|
||||
|
||||
config LLVM_POLLY
|
||||
bool "Enable LLVM's polyhedral loop optimizer (Polly)"
|
||||
help
|
||||
This option enables LLVM's polyhedral loop optimizer known as Polly.
|
||||
Polly is able to optimize various loops throughout the kernel for
|
||||
maximum cache locality. This requires an LLVM toolchain explicitly
|
||||
compiled with Polly support.
|
||||
|
||||
config HAVE_ARCH_WITHIN_STACK_FRAMES
|
||||
bool
|
||||
help
|
||||
|
||||
Reference in New Issue
Block a user