[llvm] [RISCV] Adopt SpacemitX60's scheduling model for `-mtune=generic` (PR #167008)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 14:56:55 PST 2025
================
@@ -102,7 +102,12 @@ def GENERIC_RV64 : RISCVProcessorModel<"generic-rv64",
GenericTuneInfo;
// Support generic for compatibility with other targets. The triple will be used
// to change to the appropriate rv32/rv64 version.
-def GENERIC : RISCVTuneProcessorModel<"generic", NoSchedModel>, GenericTuneInfo;
+// `generic` is expected to target in-order application processors designed for
+// general-purpose computing.
+def GENERIC : RISCVTuneProcessorModel<"generic", SpacemitX60Model>,
----------------
topperc wrote:
Ok the behavior between clang and llvm is a bit messy.
clang rejects -mcpu=generic. It requires generic-rv32/rv64 for mcpu.
With no -mcpu, clang passes generic-rv32/rv64 as the CPU.
Without an explicit mtune clang only passes a cpu in the target-cpu attribute.
Clang accepts -mtune=generic, -mtune=generic-rv32, or -mtune=generic-rv64. These will be passed in the `tune-cpu` function attribute. These will use 3 different RISCVProcessor.td entries.
So -mtune=generic uses the "generic" entry RISCVProcessors.td, but no -mtune and -mcpu=geneirc or no -mcpu uses the generic-rv32/rv64 entry.
https://github.com/llvm/llvm-project/pull/167008
More information about the llvm-commits
mailing list