[llvm] [SystemZ] Add a SystemZ specific pre-RA scheduling strategy. (PR #135076)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 06:16:53 PDT 2025


================
@@ -24,6 +34,69 @@
 
 namespace llvm {
 
+/// A MachineSchedStrategy implementation for SystemZ pre RA  scheduling.
+class SystemZPreRASchedStrategy : public GenericScheduler {
+  // The FP/Vector registers are prioritized during scheduling.
+  std::set<unsigned> PrioRegClasses;
+  void initializePrioRegClasses(const TargetRegisterInfo *TRI);
+  bool isPrioVirtReg(Register Reg, const MachineRegisterInfo *MRI) const {
+    return (Reg.isVirtual() &&
+            PrioRegClasses.count(MRI->getRegClass(Reg)->getID()));
+  }
+
+  // A TinyRegion has up to 10 instructions and is scheduled differently.
+  bool TinyRegion;
+
+  // Num instructions left to schedule.
+  unsigned NumLeft;
+
+  // Tru if latency scheduling is enabled.
+  bool ShouldReduceLatency;
+
+  // Keep track of currently live registers.
+  struct VRegSet : std::set<Register> {
----------------
arsenm wrote:

Don't subclass base data structures 

https://github.com/llvm/llvm-project/pull/135076


More information about the llvm-commits mailing list