Skip to content

Commit 0a3b143

Browse files
authored
Add support for MLIR_ENABLE_REMARK (#2625)
Signed-off-by: Tiotto, Ettore <[email protected]>
1 parent 75dcede commit 0a3b143

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

third_party/intel/backend/compiler.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)