[Mlir-commits] [mlir] 2e5f666 - Make debug counters available in non-assert builds as well

Mehdi Amini llvmlistbot at llvm.org
Wed Apr 26 08:07:31 PDT 2023


Author: Mehdi Amini
Date: 2023-04-26T08:07:24-07:00
New Revision: 2e5f6668f9a02b0815cc8202a947ba5919f46459

URL: https://github.com/llvm/llvm-project/commit/2e5f6668f9a02b0815cc8202a947ba5919f46459
DIFF: https://github.com/llvm/llvm-project/commit/2e5f6668f9a02b0815cc8202a947ba5919f46459.diff

LOG: Make debug counters available in non-assert builds as well

Differential Revision: https://reviews.llvm.org/D149232

Added: 
    

Modified: 
    mlir/lib/Debug/DebugCounter.cpp
    mlir/test/mlir-opt/debugcounter.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Debug/DebugCounter.cpp b/mlir/lib/Debug/DebugCounter.cpp
index 263fc8c80ebb7..e026a982859a9 100644
--- a/mlir/lib/Debug/DebugCounter.cpp
+++ b/mlir/lib/Debug/DebugCounter.cpp
@@ -110,10 +110,8 @@ void DebugCounter::print(raw_ostream &os) const {
 /// various flags within the DebugCounter. These flags are used when
 /// constructing a DebugCounter for initialization.
 void DebugCounter::registerCLOptions() {
-#ifndef NDEBUG
   // Make sure that the options struct has been initialized.
   *clOptions;
-#endif
 }
 
 bool DebugCounter::isActivated() {

diff  --git a/mlir/test/mlir-opt/debugcounter.mlir b/mlir/test/mlir-opt/debugcounter.mlir
index d17b4d1669810..594a2183558b5 100644
--- a/mlir/test/mlir-opt/debugcounter.mlir
+++ b/mlir/test/mlir-opt/debugcounter.mlir
@@ -1,7 +1,6 @@
 // This test exercises the example in docs/ActionTracing.md ; changes here
 // should probably be reflected there.
 
-// REQUIRES: asserts
 // RUN: mlir-opt %s -mlir-debug-counter=unique-tag-for-my-action-skip=-1 -mlir-print-debug-counter --pass-pipeline="builtin.module(func.func(canonicalize))" --mlir-disable-threading 2>&1 | FileCheck %s --check-prefix=CHECK-UNKNOWN-TAG
 // RUN: mlir-opt %s -mlir-debug-counter=pass-execution-skip=1 -mlir-print-debug-counter --pass-pipeline="builtin.module(func.func(canonicalize))" --mlir-disable-threading 2>&1 | FileCheck %s --check-prefix=CHECK-PASS
 


        


More information about the Mlir-commits mailing list