Commit b39aea84 authored by Danny Lin's avatar Danny Lin Committed by arnavpuranik
Browse files

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.
Signed-off-by: default avatarDanny Lin <danny@kdrag0n.dev>
parent c347855f
......@@ -637,6 +637,17 @@ ARCH_AFLAGS :=
ARCH_CFLAGS :=
include arch/$(SRCARCH)/Makefile
ifdef CONFIG_LLVM_POLLY
KBUILD_CFLAGS += -mllvm -polly \
-mllvm -polly-run-dce \
-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
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
......
......@@ -423,6 +423,14 @@ config CC_STACKPROTECTOR_STRONG
endchoice
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment