Skip to content

[RISCV][NFC] Move GenericModel to standalone file #127003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

wangpc-pp
Copy link
Contributor

And fix some typos in comments.

In the future, we may add more scheduling info to GenericModel.

And fix some typos in comments.

In the future, we may add more scheduling info to GenericModel.
@llvmbot
Copy link
Member

llvmbot commented Feb 13, 2025

@llvm/pr-subscribers-backend-risc-v

Author: Pengcheng Wang (wangpc-pp)

Changes

And fix some typos in comments.

In the future, we may add more scheduling info to GenericModel.


Full diff: https://github.com/llvm/llvm-project/pull/127003.diff

3 Files Affected:

  • (modified) llvm/lib/Target/RISCV/RISCV.td (+1)
  • (modified) llvm/lib/Target/RISCV/RISCVProcessors.td (-9)
  • (added) llvm/lib/Target/RISCV/RISCVSchedGeneric.td (+18)
diff --git a/llvm/lib/Target/RISCV/RISCV.td b/llvm/lib/Target/RISCV/RISCV.td
index 87c07c3cd505f..1e7ce136dc327 100644
--- a/llvm/lib/Target/RISCV/RISCV.td
+++ b/llvm/lib/Target/RISCV/RISCV.td
@@ -46,6 +46,7 @@ include "RISCVMacroFusion.td"
 // RISC-V Scheduling Models
 //===----------------------------------------------------------------------===//
 
+include "RISCVSchedGeneric.td"
 include "RISCVSchedMIPSP8700.td"
 include "RISCVSchedRocket.td"
 include "RISCVSchedSiFive7.td"
diff --git a/llvm/lib/Target/RISCV/RISCVProcessors.td b/llvm/lib/Target/RISCV/RISCVProcessors.td
index c54afa1e6e72e..05fcbfd42b092 100644
--- a/llvm/lib/Target/RISCV/RISCVProcessors.td
+++ b/llvm/lib/Target/RISCV/RISCVProcessors.td
@@ -88,15 +88,6 @@ class RISCVTuneProcessorModel<string n,
 
 defvar GenericTuneFeatures = [TuneOptimizedNF2SegmentLoadStore];
 
-// Adjust the default cost model to enable all heuristics, not just latency
-// In particular, this enables register pressure heustics which are very
-// important for high LMUL vector code, and have little negative impact
-// on other configurations,
-def GenericModel : SchedMachineModel {
-  let MicroOpBufferSize = 1;
-  let CompleteModel = 0;
-}
-
 def GENERIC_RV32 : RISCVProcessorModel<"generic-rv32",
                                        GenericModel,
                                        [Feature32Bit,
diff --git a/llvm/lib/Target/RISCV/RISCVSchedGeneric.td b/llvm/lib/Target/RISCV/RISCVSchedGeneric.td
new file mode 100644
index 0000000000000..a10cf624aa3a4
--- /dev/null
+++ b/llvm/lib/Target/RISCV/RISCVSchedGeneric.td
@@ -0,0 +1,18 @@
+//===-- RISCVSchedGeneric.td - Generic In-order Processor --*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// Adjust the default cost model to enable all scheduling heuristics, not just
+// latency.
+//
+// In particular, this enables register pressure heuristics which are very
+// important for vector code with high LMULs, and have little negative impact
+// on other configurations.
+def GenericModel : SchedMachineModel {
+  let MicroOpBufferSize = 1;
+  let CompleteModel = 0;
+}

Copy link
Collaborator

@topperc topperc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangpc-pp wangpc-pp merged commit 9cc8442 into llvm:main Feb 13, 2025
8 of 10 checks passed
@wangpc-pp wangpc-pp deleted the main-riscv-generic-model branch February 13, 2025 07:26
flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
And fix some typos in comments.

In the future, we may add more scheduling info to GenericModel.
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
And fix some typos in comments.

In the future, we may add more scheduling info to GenericModel.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
And fix some typos in comments.

In the future, we may add more scheduling info to GenericModel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants