[PATCH] D17260: SystemZ scheduling implementation

Andrew Trick via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 09:44:29 PST 2016


atrick added inline comments.

================
Comment at: lib/Target/SystemZ/SystemZISelLowering.cpp:123-138
@@ -118,8 +122,18 @@
 
-  // TODO: It may be better to default to latency-oriented scheduling, however
-  // LLVM's current latency-oriented scheduler can't handle physreg definitions
-  // such as SystemZ has with CC, so set this to the register-pressure
-  // scheduler, because it can.
-  setSchedulingPreference(Sched::RegPressure);
+  // XXJ Experimental.
+  if (Subtarget.isZ10orGeneric())
+    setSchedulingPreference(Sched::RegPressure);
+  else {
+    if (SchedPref=="source")
+      setSchedulingPreference(Sched::Source);
+    else if (SchedPref=="hybrid")
+      setSchedulingPreference(Sched::Hybrid);
+    else if (SchedPref=="ilp")
+      setSchedulingPreference(Sched::ILP);
+    else if (SchedPref=="regpress")
+      setSchedulingPreference(Sched::RegPressure);
+    else
+      llvm_unreachable("bad schedpref string");
+  }
 
   setBooleanContents(ZeroOrOneBooleanContent);
----------------
Right, I was looking at your PostRA policy, which is rightly top-down. That said, you might still achieve better register pressure results by a two-pass scheduling approach. I tried hard to wedge all heuristics into a single pass because I was paranoid about compile time.

Ultimately it's whatever works for  your target, I was just pointing out that
- SelectionDAG is a bad place for scheduler heuristics
- We could support a multiple-pass MI scheduler if anyone needs it

================
Comment at: lib/Target/SystemZ/SystemZScheduleZ13.td:44
@@ +43,3 @@
+def Z13_FPdUnit : ProcResource<2> { let BufferSize = 0; /* blocking */ }
+
+def : WriteRes<GroupAlone, []> {
----------------
It wasn't a complete/general fix. But yes, I'll encourage anyone I can to improve the in-tree code. Out-of-tree work usually leads to problems.

On the other hand, making it easy to write custom, possibly out-of-tree schedulers was a major goal of MI scheduling.


http://reviews.llvm.org/D17260





More information about the llvm-commits mailing list