[llvm] [AMDGPU] Model WMMA co-execution windows in the scheduler for gfx1250 (PR #204077)

Alexey Sachkov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 03:18:00 PDT 2026


================
@@ -26,6 +26,18 @@
 using namespace llvm;
 
 #define DEBUG_TYPE "gcn-hazard-recognizer"
+#define DEBUG_TYPE_VERBOSE "gcn-hazard-recognizer-verbose"
+
+// Verbose debug type implies normal debug output. LLVM_DEBUG only fires for
+// DEBUG_TYPE, so we replace it with this macro in preRA code. This fires when
+// either -debug-only=gcn-hazard-recognizer or
+// -debug-only=gcn-hazard-recognizer-verbose is passed.
+#define LLVM_DEBUG_HR(X)                                                       \
+  do {                                                                         \
+    LLVM_DEBUG(X);                                                             \
+    DEBUG_WITH_TYPE(                                                           \
+        DEBUG_TYPE_VERBOSE, if (!isCurrentDebugType(DEBUG_TYPE)) { X; });      \
----------------
AlexeySachkov wrote:

Out of curiosity, why the `if (!isCurrentDebugType(DEBUG_TYPE))` is needed? `DEBUG_WITH_TYPE` is defined as:

https://github.com/llvm/llvm-project/blob/0155172db818f7c3592b96bfc75cb61ae3fd57c0/llvm/include/llvm/Support/Debug.h#L72-L77

Meaning that if the code snippet passed to the macro is invoked, then `!isCurrentDebugType(DEBUG_TYPE)` is always true and can be omitted.


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


More information about the llvm-commits mailing list