[llvm] [MCA] Use LLVM_DEBUG instead of direct NDEBUG check (NFC) (PR #189389)
Tomer Shafir via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 07:08:52 PDT 2026
https://github.com/tomershafir created https://github.com/llvm/llvm-project/pull/189389
Use the conventional multiline `LLVM_DEBUG` macro for a debug-printing-only code block, instead of unwrapping a direct `NDEBUG` check.
>From eb45525a510816c137b72801fa3fb1c6fe08c507 Mon Sep 17 00:00:00 2001
From: tomershafir <tomer.shafir8 at gmail.com>
Date: Mon, 30 Mar 2026 17:01:46 +0300
Subject: [PATCH] [MCA] Use LLVM_DEBUG instead of direct NDEBUG check (NFC)
Use the conventional multiline `LLVM_DEBUG` macro for a debug-printing-only code block, instead of unwrapping a direct `NDEBUG` check.
---
llvm/lib/MCA/Support.cpp | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/llvm/lib/MCA/Support.cpp b/llvm/lib/MCA/Support.cpp
index f8b8a2d129c1c..5d42963fbcceb 100644
--- a/llvm/lib/MCA/Support.cpp
+++ b/llvm/lib/MCA/Support.cpp
@@ -68,16 +68,15 @@ void computeProcResourceMasks(const MCSchedModel &SM,
ProcResourceID++;
}
-#ifndef NDEBUG
- LLVM_DEBUG(dbgs() << "\nProcessor resource masks:"
- << "\n");
- for (unsigned I = 0, E = SM.getNumProcResourceKinds(); I < E; ++I) {
- const MCProcResourceDesc &Desc = *SM.getProcResource(I);
- LLVM_DEBUG(dbgs() << '[' << format_decimal(I,2) << "] " << " - "
- << format_hex(Masks[I],16) << " - "
- << Desc.Name << '\n');
- }
-#endif
+ LLVM_DEBUG({
+ dbgs() << "\nProcessor resource masks:\n";
+ for (unsigned I = 0, E = SM.getNumProcResourceKinds(); I < E; ++I) {
+ const MCProcResourceDesc &Desc = *SM.getProcResource(I);
+ dbgs() << '[' << format_decimal(I,2) << "] " << " - "
+ << format_hex(Masks[I],16) << " - "
+ << Desc.Name << '\n';
+ }
+ });
}
double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth,
More information about the llvm-commits
mailing list