Skip to content

[MLIR][mlir-opt] move action debugger hook flag #134842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ class MlirOptMainConfig {
/// Elide resources when generating bytecode.
bool elideResourceDataFromBytecodeFlag = false;

/// Enable the Debugger action hook: Debugger can intercept MLIR Actions.
bool enableDebuggerActionHookFlag = false;

/// IRDL file to register before processing the input.
std::string irdlFileFlag = "";

Expand Down
5 changes: 5 additions & 0 deletions mlir/lib/Debug/CLOptionsSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ struct DebugConfigCLOptions : public DebugConfig {
auto [file, line, col] = *locBreakpoint;
locBreakpointManager.addBreakpoint(file, line, col);
}));

static cl::opt<bool, /*ExternalStorage=*/true> enableDebuggerHook(
"mlir-enable-debugger-hook",
cl::desc("Enable Debugger hook for debugging MLIR Actions"),
cl::location(enableDebuggerActionHookFlag), cl::init(false));
}
tracing::FileLineColLocBreakpointManager locBreakpointManager;
};
Expand Down
5 changes: 0 additions & 5 deletions mlir/lib/Tools/mlir-opt/MlirOptMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ struct MlirOptMainConfigCLOptions : public MlirOptMainConfig {
"mlir-disable-diagnostic-notes", cl::desc("Disable diagnostic notes."),
cl::location(disableDiagnosticNotesFlag), cl::init(false));

static cl::opt<bool, /*ExternalStorage=*/true> enableDebuggerHook(
"mlir-enable-debugger-hook",
cl::desc("Enable Debugger hook for debugging MLIR Actions"),
cl::location(enableDebuggerActionHookFlag), cl::init(false));

static cl::opt<bool, /*ExternalStorage=*/true> explicitModule(
"no-implicit-module",
cl::desc("Disable implicit addition of a top-level module op during "
Expand Down
9 changes: 9 additions & 0 deletions mlir/test/mlir-opt/debuggerhook.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Checks that the debugger hook is enabled when called with the CLI option.
// RUN: mlir-opt %s --mlir-enable-debugger-hook --pass-pipeline="builtin.module(func.func(canonicalize))" --mlir-disable-threading 2>&1 | FileCheck %s

func.func @foo() {
return
}

// CHECK: ExecutionContext registered on the context
// CHECK-SAME: (with Debugger hook)