Revert "kbuild: Add support for LLVM's Polly optimizer"

This reverts commit fc33cc16b14c9a54cce17c6f9f96d8b3d542f7e3.

Change-Id: Ieff0a3f219e76351a355de03138320ccd4d7c360
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
Richard Raya 2024-04-23 20:01:15 -03:00
parent 7b4e8ef7a3
commit 87265ff842
2 changed files with 2 additions and 47 deletions

View File

@ -714,9 +714,9 @@ LLVM_AR := llvm-ar
LLVM_NM := llvm-nm
export LLVM_AR LLVM_NM
# Set O3 optimization level for LTO with most linkers
# Set O3 optimization level for LTO
LDFLAGS += --plugin-opt=O3
LDFLAGS += --plugin-opt=-import-instr-limit=40
endif
# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
@ -743,43 +743,6 @@ KBUILD_CFLAGS += -mcpu=cortex-a76.cortex-a55 -mtune=cortex-a76.cortex-a55
endif
ifeq ($(cc-name),clang)
KBUILD_CFLAGS += -mcpu=cortex-a55 -mtune=cortex-a55
ifdef CONFIG_LTO_CLANG
KBUILD_CFLAG += -fwhole-program-vtables
endif
ifdef CONFIG_LLVM_POLLY
KBUILD_CFLAGS += -mllvm -polly \
-mllvm -polly-run-inliner \
-mllvm -polly-ast-use-context \
-mllvm -polly-detect-keep-going \
-mllvm -polly-invariant-load-hoisting \
-mllvm -polly-vectorizer=stripmine
ifeq ($(shell test $(CONFIG_CLANG_VERSION) -gt 130000; echo $$?),0)
KBUILD_CFLAGS += -mllvm -polly-loopfusion-greedy=1 \
-mllvm -polly-reschedule=1 \
-mllvm -polly-postopts=1 \
-mllvm -polly-num-threads=0 \
-mllvm -polly-omp-backend=LLVM \
-mllvm -polly-scheduling=dynamic \
-mllvm -polly-scheduling-chunksize=1
else
KBUILD_CFLAGS += -mllvm -polly-isl-arg=--no-schedule-serialize-sccs
endif
KBUILD_CFLAGS += $(POLLY_FLAGS)
KBUILD_AFLAGS += $(POLLY_FLAGS)
KBUILD_LDFLAGS += $(POLLY_FLAGS)
# Polly may optimise loops with dead paths beyound what the linker
# can understand. This may negate the effect of the linker's DCE
# so we tell Polly to perfom proven DCE on the loops it optimises
# in order to preserve the overall effect of the linker's DCE.
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
POLLY_FLAGS += -mllvm -polly-run-dce
endif
endif
endif
endif

View File

@ -735,14 +735,6 @@ 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