Makefile: Rework on Polly optimizer flags

Commits that have been squashed are as follows:

1. d569f7e09f
2. 24a11f1008
3. 50e16d01b4
4. 86fb97a73b

[ Tashar02: Conditionally place the flags as they are only supported by clang greater than version 13.0.0 ]

Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
Co-authored-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Divyanshu-Modi <divyan.m05@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
This commit is contained in:
Carlos Jimenez (JavaShin-X) 2022-01-03 14:12:15 +05:30 committed by Ksawlii
parent 3c4fb71b04
commit ceba42cff9

View file

@ -811,11 +811,30 @@ endif
ifdef CONFIG_LLVM_POLLY ifdef CONFIG_LLVM_POLLY
KBUILD_CFLAGS += -mllvm -polly \ KBUILD_CFLAGS += -mllvm -polly \
-mllvm -polly-run-inliner \ -mllvm -polly-run-inliner \
-mllvm -polly-opt-fusion=max \
-mllvm -polly-ast-use-context \ -mllvm -polly-ast-use-context \
-mllvm -polly-detect-keep-going \ -mllvm -polly-detect-keep-going \
-mllvm -polly-vectorizer=stripmine \ -mllvm -polly-invariant-load-hoisting \
-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-opt-fusion=max
endif
# 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
# Tell gcc to never replace conditional load with a non-conditional one # Tell gcc to never replace conditional load with a non-conditional one