1
0
Files
linux/debian/patches/mixed-arch/0006-XANMOD-kbuild-Add-GCC-SMS-based-modulo-scheduling-fl.patch
2025-03-27 01:51:30 +03:00

27 lines
1022 B
Diff

From b1a99a2a9675f80b7c04a239a6b047373ccf3a17 Mon Sep 17 00:00:00 2001
From: Alexandre Frade <kernel@xanmod.org>
Date: Mon, 16 Sep 2024 00:55:35 +0000
Subject: XANMOD: kbuild: Add GCC SMS-based modulo scheduling flags
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
---
Makefile | 4 ++++
1 file changed, 4 insertions(+)
--- a/Makefile
+++ b/Makefile
@@ -884,6 +884,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)