From b1a99a2a9675f80b7c04a239a6b047373ccf3a17 Mon Sep 17 00:00:00 2001 From: Alexandre Frade Date: Mon, 16 Sep 2024 00:55:35 +0000 Subject: XANMOD: kbuild: Add GCC SMS-based modulo scheduling flags Signed-off-by: Alexandre Frade --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) --- a/Makefile +++ b/Makefile @@ -883,6 +883,13 @@ ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE KBUILD_CFLAGS += $(call cc-option,-fivopts) endif +ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 +# Perform swing modulo scheduling immediately before the first scheduling pass. +# This pass looks at innermost loops and reorders their instructions by +# overlapping different iterations. +KBUILD_CFLAGS += $(call cc-option,-fmodulo-sched -fmodulo-sched-allow-regmoves) +endif + # Always set `debug-assertions` and `overflow-checks` because their default # depends on `opt-level` and `debug-assertions`, respectively. KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n)