Skip to content

Commit ed3d094

Browse files
Only print warning under MLIR_ENABLE_DIAGNOSTICS (#2943)
As explained in https://github.com/intel/intel-xpu-backend-for-triton/pull/1048/files#r1871965306, we would like to be consistent with upstream to only print warning under env var `MLIR_ENABLE_DIAGNOSTICS`. Signed-off-by: Whitney Tsang <[email protected]>
1 parent 37a4568 commit ed3d094

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/src/ir.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,11 +1680,11 @@ void init_triton_ir(py::module &&m) {
16801680
if (haveDiagnostics) {
16811681
context->printOpOnDiagnostic(true);
16821682
context->printStackTraceOnDiagnostic(true);
1683+
context->getDiagEngine().registerHandler([](Diagnostic &diag) {
1684+
llvm::outs() << diag << "\n";
1685+
return success();
1686+
});
16831687
}
1684-
context->getDiagEngine().registerHandler([](Diagnostic &diag) {
1685-
llvm::outs() << diag << "\n";
1686-
return success();
1687-
});
16881688
if (haveDump) {
16891689
auto printingFlags = OpPrintingFlags();
16901690
printingFlags.elideLargeElementsAttrs(16);

0 commit comments

Comments
 (0)