[llvm] [RISCV][Scheduler] Split `UnsupportedSchedZfa` by other fp extensions (PR #140186)

Iris Shi via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 21:32:17 PDT 2025


https://github.com/el-ev created https://github.com/llvm/llvm-project/pull/140186

Originally posted by @wangpc-pp and @el-ev in https://github.com/llvm/llvm-project/pull/140003#discussion_r2090711052

> Probably `UnsupportedSchedZfaWithD`/`UnsupportedSchedZfaWithZfh` are also needed to be defined.

> Yeah, I tend to do that. Zfa is special because it is orthogonal to other floating-point extensions.

>From a5d7f5f6b761b3253fad68f038ade12ec7619782 Mon Sep 17 00:00:00 2001
From: Iris Shi <0.0 at owo.li>
Date: Fri, 16 May 2025 12:28:45 +0800
Subject: [PATCH] [RISCV][Scheduler] Split `UnsupportedSchedZfa` by other fp
 extensions

---
 llvm/lib/Target/RISCV/RISCVSchedule.td | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/llvm/lib/Target/RISCV/RISCVSchedule.td b/llvm/lib/Target/RISCV/RISCVSchedule.td
index f23325b1d8dc2..4d49ad4d6b317 100644
--- a/llvm/lib/Target/RISCV/RISCVSchedule.td
+++ b/llvm/lib/Target/RISCV/RISCVSchedule.td
@@ -454,18 +454,31 @@ def : ReadAdvance<ReadFRoundF128, 0>;
 }
 }
 
-multiclass UnsupportedSchedZfa : UnsupportedSchedZfaWithQ {
+multiclass UnsupportedSchedZfaWithD : UnsupportedSchedZfaWithQ {
 let Unsupported = true in {
-def : WriteRes<WriteFRoundF16, []>;
-def : WriteRes<WriteFRoundF32, []>;
 def : WriteRes<WriteFRoundF64, []>;
-def : WriteRes<WriteFLI16, []>;
-def : WriteRes<WriteFLI32, []>;
 def : WriteRes<WriteFLI64, []>;
 
-def : ReadAdvance<ReadFRoundF32, 0>;
 def : ReadAdvance<ReadFRoundF64, 0>;
+}
+}
+
+multiclass UnsupportedSchedZfaWithZfh {
+let Unsupported = true in {
+def : WriteRes<WriteFRoundF16, []>;
+def : WriteRes<WriteFLI16, []>;
+
 def : ReadAdvance<ReadFRoundF16, 0>;
+}
+}
+
+multiclass UnsupportedSchedZfa : UnsupportedSchedZfaWithD,
+                                 UnsupportedSchedZfaWithZfh {
+let Unsupported = true in {
+def : WriteRes<WriteFRoundF32, []>;
+def : WriteRes<WriteFLI32, []>;
+
+def : ReadAdvance<ReadFRoundF32, 0>;
 } // Unsupported = true
 }
 



More information about the llvm-commits mailing list