[PATCH] D86684: [NFC][Refactor] Add the SchedHeuristic for Scheduler to allow platform customizing the heuristics

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 03:29:28 PDT 2020


qiucf added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachineScheduler.h:974
+           "Unable to compare the priority for these two heruistics");
+    return std::find(Heuristics.begin(), Heuristics.end(), Reason1) <
+           std::find(Heuristics.begin(), Heuristics.end(), Reason2);
----------------
So every time we'll need to iterate over this list? Maybe we can add a field like `rank` in `SchedHeuristic` and auto-fill them in registering?


================
Comment at: llvm/lib/CodeGen/MachineScheduler.cpp:2544
+void GenericSchedulerBase::initializeHeuristics() {
+#define PHYSREG "PHYS-REG"
+#define ORDER "ORDER"
----------------
Use `#define STR(X) #X`?


================
Comment at: llvm/lib/CodeGen/MachineScheduler.cpp:2864
+
+  if (Cand.Reason) {
+    if (Cand.Reason->Name == RESREDUCE)
----------------
Use `StringSwitch` for below?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86684/new/

https://reviews.llvm.org/D86684



More information about the llvm-commits mailing list