@@ -210,6 +210,11 @@ def make_ttgir(mod, metadata, opt, properties):
210210 cluster_info .clusterDimX = opt .cluster_dims [0 ]
211211 cluster_info .clusterDimY = opt .cluster_dims [1 ]
212212 cluster_info .clusterDimZ = opt .cluster_dims [2 ]
213+ # Set up Diagnostic
214+ if os .environ .get ("MLIR_ENABLE_REMARK" , "0" ) == "1" :
215+ srcMgr = llvm .source_mgr ()
216+ ir .source_mgr_diag (srcMgr , mod .context )
217+ mod .context .printOpOnDiagnostic (True )
213218
214219 # Annotate module with information required by subsequent transformations.
215220 pm = ir .pass_manager (mod .context )
@@ -270,6 +275,11 @@ def make_llir(src, metadata, options):
270275 # TritonGPU -> LLVM-IR (MLIR)
271276 pm = ir .pass_manager (mod .context )
272277 pm .enable_debug ()
278+ # Set up Diagnostic
279+ if os .environ .get ("MLIR_ENABLE_REMARK" , "0" ) == "1" :
280+ srcMgr = llvm .source_mgr ()
281+ ir .source_mgr_diag (srcMgr , mod .context )
282+ mod .context .printOpOnDiagnostic (True )
273283 # FIXME: Advanced path drops tensor layouts, so this will crash on some
274284 # operations being used, e.g., convert_layout.
275285 if os .getenv ("TRITON_INTEL_REDUCE_TRANSPOSE" , "0" ) != "1" :
0 commit comments