Skip to content

Commit

Permalink
Fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
gflegar committed Feb 19, 2024
1 parent b4e2d1f commit 0aa6b95
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions python/src/ir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1423,28 +1423,28 @@ void init_triton_ir(py::module &&m) {
.def("enable_debug",
[](PassManager &self) {
auto *context = self.getContext();
bool have_diagnostics =
bool haveDiagnostics =
::triton::tools::getBoolEnv("MLIR_ENABLE_DIAGNOSTICS");
bool have_dump = ::triton::tools::getBoolEnv("MLIR_ENABLE_DUMP");
if (have_diagnostics || have_dump) {
bool haveDump = ::triton::tools::getBoolEnv("MLIR_ENABLE_DUMP");
if (haveDiagnostics || haveDump) {
context->disableMultithreading();
}
if (have_diagnostics) {
if (haveDiagnostics) {
context->printOpOnDiagnostic(true);
context->printStackTraceOnDiagnostic(true);
context->getDiagEngine().registerHandler([](Diagnostic &diag) {
llvm::outs() << diag << "\n";
return success();
});
}
if (have_dump) {
if (haveDump) {
auto printingFlags = OpPrintingFlags();
printingFlags.elideLargeElementsAttrs(16);
printingFlags.enableDebugInfo();
auto print_always = [](Pass *, Operation *) { return true; };
auto printAlways = [](Pass *, Operation *) { return true; };
self.enableIRPrinting(
/*shouldPrintBeforePass=*/print_always,
/*shouldPrintAfterPass=*/print_always,
/*shouldPrintBeforePass=*/printAlways,
/*shouldPrintAfterPass=*/printAlways,
/*printModuleScope=*/true,
/*printAfterOnlyOnChange=*/false,
/*printAfterOnlyOnFailure*/ true, llvm::dbgs(),
Expand Down

0 comments on commit 0aa6b95

Please sign in to comment.