[all-commits] [llvm/llvm-project] 4f919f: [mlir][llvm] support DICompileUnit source language...

Gibran Essa via All-commits all-commits at lists.llvm.org
Fri Aug 7 11:54:45 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f919f48a3b1c2705830ff302095a5413fb245ef
      https://github.com/llvm/llvm-project/commit/4f919f48a3b1c2705830ff302095a5413fb245ef
  Author: Gibran Essa <gibran.essa at gmail.com>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M mlir/include/mlir-c/Dialect/LLVM.h
    M mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMDialectBytecode.td
    M mlir/lib/CAPI/Dialect/LLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMAttrs.cpp
    M mlir/lib/Target/LLVMIR/DebugImporter.cpp
    M mlir/lib/Target/LLVMIR/DebugTranslation.cpp
    M mlir/test/CAPI/llvm.c
    M mlir/test/Dialect/LLVMIR/bytecode.mlir
    M mlir/test/Dialect/LLVMIR/debuginfo.mlir
    M mlir/test/Target/LLVMIR/Import/debug-info.ll
    M mlir/test/Target/LLVMIR/llvmir-debug.mlir

  Log Message:
  -----------
  [mlir][llvm] support DICompileUnit source language dialect (#214301)

## Summary

LLVM IR `DICompileUnit` supports an optional `dialect:` field as part of
its `DISourceLanguageName`, for example:

```
!0 = distinct !DICompileUnit(
  language: DW_LANG_C,
  file: !1,
  dialect: DW_LLVM_LANG_DIALECT_simt
)
```

The MLIR LLVM dialect previously modeled only the base `sourceLanguage`,
so LLVM IR import dropped the dialect and MLIR-to-LLVMIR export could
not emit it.

This patch adds `sourceLanguageDialect` to `#llvm.di_compile_unit`,
defaulting to `0`, and wires it through:

- MLIR LLVM dialect attribute parsing/printing
- recursive debug-info cloning
- LLVM dialect bytecode
- LLVM IR export
- LLVM IR import
- C API construction, while preserving the existing constructor behavior
with a default dialect

The new MLIR format is:

```
#llvm.di_compile_unit<
  id = distinct[0]<>,
  sourceLanguage = DW_LANG_C,
  sourceLanguageDialect = DW_LLVM_LANG_DIALECT_simt,
  file = #file
>
```
AI assistance from codex was used in this MR.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list