[PATCH] D68264: [AMDGPU] Add VerifyScheduling support.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 08:44:28 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL373346: [AMDGPU] Add VerifyScheduling support. (authored by foad, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D68264?vs=222572&id=222632#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D68264

Files:
  llvm/trunk/include/llvm/CodeGen/MachineScheduler.h
  llvm/trunk/lib/CodeGen/MachineScheduler.cpp
  llvm/trunk/lib/Target/AMDGPU/GCNSchedStrategy.cpp


Index: llvm/trunk/include/llvm/CodeGen/MachineScheduler.h
===================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineScheduler.h
+++ llvm/trunk/include/llvm/CodeGen/MachineScheduler.h
@@ -100,6 +100,7 @@
 
 extern cl::opt<bool> ForceTopDown;
 extern cl::opt<bool> ForceBottomUp;
+extern cl::opt<bool> VerifyScheduling;
 
 class LiveIntervals;
 class MachineDominatorTree;
Index: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp
@@ -82,6 +82,10 @@
 DumpCriticalPathLength("misched-dcpl", cl::Hidden,
                        cl::desc("Print critical path length to stdout"));
 
+cl::opt<bool> VerifyScheduling(
+    "verify-misched", cl::Hidden,
+    cl::desc("Verify machine instrs before and after machine scheduling"));
+
 } // end namespace llvm
 
 #ifndef NDEBUG
@@ -122,9 +126,6 @@
                                         cl::desc("Enable memop clustering."),
                                         cl::init(true));
 
-static cl::opt<bool> VerifyScheduling("verify-misched", cl::Hidden,
-  cl::desc("Verify machine instrs before and after machine scheduling"));
-
 // DAG subtrees must have at least this many nodes.
 static const unsigned MinSubtreeSize = 8;
 
Index: llvm/trunk/lib/Target/AMDGPU/GCNSchedStrategy.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ llvm/trunk/lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -196,6 +196,15 @@
     assert(BotCand.Reason != NoCand && "failed to find the first candidate");
   } else {
     LLVM_DEBUG(traceCandidate(BotCand));
+#ifndef NDEBUG
+    if (VerifyScheduling) {
+      SchedCandidate TCand;
+      TCand.reset(CandPolicy());
+      pickNodeFromQueue(Bot, BotPolicy, DAG->getBotRPTracker(), TCand);
+      assert(TCand.SU == BotCand.SU &&
+             "Last pick result should correspond to re-picking right now");
+    }
+#endif
   }
 
   // Check if the top Q has a better candidate.
@@ -207,6 +216,15 @@
     assert(TopCand.Reason != NoCand && "failed to find the first candidate");
   } else {
     LLVM_DEBUG(traceCandidate(TopCand));
+#ifndef NDEBUG
+    if (VerifyScheduling) {
+      SchedCandidate TCand;
+      TCand.reset(CandPolicy());
+      pickNodeFromQueue(Top, TopPolicy, DAG->getTopRPTracker(), TCand);
+      assert(TCand.SU == TopCand.SU &&
+           "Last pick result should correspond to re-picking right now");
+    }
+#endif
   }
 
   // Pick best from BotCand and TopCand.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68264.222632.patch
Type: text/x-patch
Size: 2650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191001/09a2894d/attachment.bin>


More information about the llvm-commits mailing list