[PATCH] D153450: [RISCV] Seperate scheduler calsses for vfredmax/min
Michael Maitland via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 21 11:28:13 PDT 2023
michaelmaitland created this revision.
michaelmaitland added reviewers: craig.topper, reames, wangpc.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
michaelmaitland requested review of this revision.
Herald added subscribers: llvm-commits, eopXD, MaskRay.
Herald added a project: LLVM.
vfredmax/min may have different scheduling behavior on different
microarchitectures compared to other reductions. This different
behavior can be described by giving vfredmax/min separate
scheduling resources.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D153450
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
llvm/lib/Target/RISCV/RISCVScheduleV.td
Index: llvm/lib/Target/RISCV/RISCVScheduleV.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVScheduleV.td
+++ llvm/lib/Target/RISCV/RISCVScheduleV.td
@@ -409,6 +409,7 @@
// 14.3. Vector Single-Width Floating-Point Reduction Instructions
defm "" : LMULSEWSchedWritesF<"WriteVFRedV_From">;
defm "" : LMULSEWSchedWritesF<"WriteVFRedOV_From">;
+defm "" : LMULSEWSchedWritesF<"WriteVFRedMinMaxV_From">;
// 14.4. Vector Widening Floating-Point Reduction Instructions
defm "" : LMULSEWSchedWritesFWRed<"WriteVFWRedV_From">;
defm "" : LMULSEWSchedWritesFWRed<"WriteVFWRedOV_From">;
@@ -633,6 +634,7 @@
def ReadVFRedV0 : SchedRead;
def ReadVFRedOV : SchedRead;
def ReadVFRedOV0 : SchedRead;
+def ReadVFRedMinMaxV : SchedRead;
// 14.4. Vector Widening Floating-Point Reduction Instructions
def ReadVFWRedV : SchedRead;
def ReadVFWRedV0 : SchedRead;
@@ -847,6 +849,7 @@
defm "" : LMULSEWWriteResWRed<"WriteVIWRedV_From", []>;
defm "" : LMULSEWWriteResF<"WriteVFRedV_From", []>;
defm "" : LMULSEWWriteResF<"WriteVFRedOV_From", []>;
+defm "" : LMULSEWWriteResF<"WriteVFRedMinMaxV_From", []>;
defm "" : LMULSEWWriteResFWRed<"WriteVFWRedV_From", []>;
defm "" : LMULSEWWriteResFWRed<"WriteVFWRedOV_From", []>;
@@ -1006,6 +1009,7 @@
def : ReadAdvance<ReadVFRedV0, 0>;
def : ReadAdvance<ReadVFRedOV, 0>;
def : ReadAdvance<ReadVFRedOV0, 0>;
+def : ReadAdvance<ReadVFRedMinMaxV, 0>;
def : ReadAdvance<ReadVFWRedV, 0>;
def : ReadAdvance<ReadVFWRedV0, 0>;
def : ReadAdvance<ReadVFWRedOV, 0>;
Index: llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
+++ llvm/lib/Target/RISCV/RISCVSchedSiFive7.td
@@ -628,6 +628,7 @@
defm "" : LMULSEWWriteRes<"WriteVIWRedV_From", [SiFive7VA]>;
defm "" : LMULSEWWriteRes<"WriteVFRedV_From", [SiFive7VA]>;
defm "" : LMULSEWWriteRes<"WriteVFRedOV_From", [SiFive7VA]>;
+defm "" : LMULSEWWriteResF<"WriteVFRedMinMaxV_From", [SiFive7VA]>;
defm "" : LMULSEWWriteResFWRed<"WriteVFWRedV_From", [SiFive7VA]>;
defm "" : LMULSEWWriteResFWRed<"WriteVFWRedOV_From", [SiFive7VA]>;
}
Index: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -3456,6 +3456,18 @@
}
}
+multiclass VPseudoVFREDMINMAX_VS {
+ foreach m = MxListF in {
+ defvar mx = m.MX;
+ foreach e = SchedSEWSet<mx, /*isF*/ 1>.val in {
+ defvar WriteVFRedMinMaxV_From_MX_E = !cast<SchedWrite>("WriteVFRedMinMaxV_From_" # mx # "_E" # e);
+ defm _VS : VPseudoTernaryWithTailPolicy<V_M1.vrclass, m.vrclass, V_M1.vrclass, m, e>,
+ Sched<[WriteVFRedMinMaxV_From_MX_E, ReadVFRedV, ReadVFRedV, ReadVFRedV,
+ ReadVMask]>;
+ }
+ }
+}
+
multiclass VPseudoVFREDO_VS {
foreach m = MxListF in {
defvar mx = m.MX;
@@ -6152,8 +6164,8 @@
defm PseudoVFREDUSUM : VPseudoVFRED_VS;
}
let mayRaiseFPException = true in {
-defm PseudoVFREDMIN : VPseudoVFRED_VS;
-defm PseudoVFREDMAX : VPseudoVFRED_VS;
+defm PseudoVFREDMIN : VPseudoVFREDMINMAX_VS;
+defm PseudoVFREDMAX : VPseudoVFREDMINMAX_VS;
}
//===----------------------------------------------------------------------===//
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153450.533351.patch
Type: text/x-patch
Size: 3392 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230621/bd3e4562/attachment.bin>
More information about the llvm-commits
mailing list