This PR introduces an LLVM vendor DWARF attribute on compile units that carries an optional target-specific language dialect enumerator, distinct from DW_LANG_*. The intent of this addition is to allow a DWARF consumer to differentiate the source programming language from the programming model (e.g., CUDA/SIMT, Tile, etc.). This concept could also be used to differentiate OpenMP, or other parallel models, from host language. As older languages adopt newer programming models, there's no need to introduce a new language enumerator to encode that representation; rather, the model can be encoded as a dialect and treated as a refinement to the source language being compiled. For ease of extensibility, we've decided to represent the value of this new dialect attribute as a string. Code/comments/description were developed with LLM assistance. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
1.2 KiB
LLVM
21 lines
1.2 KiB
LLVM
; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
|
|
|
|
; CHECK: !{{.*}} = distinct !DICompileUnit(language: DW_LANG_C_plus_plus
|
|
; CHECK-SAME: dialect: DW_LLVM_LANG_DIALECT_simt
|
|
; CHECK: !{{.*}} = distinct !DICompileUnit(sourceLanguageName: DW_LNAME_C_plus_plus, sourceLanguageVersion: 202002
|
|
; CHECK-SAME: dialect: DW_LLVM_LANG_DIALECT_tile
|
|
|
|
source_filename = "cu.cpp"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
!llvm.dbg.cu = !{!0, !1}
|
|
!llvm.module.flags = !{!2, !3}
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !5, splitDebugInlining: false, nameTableKind: None, dialect: DW_LLVM_LANG_DIALECT_simt)
|
|
!1 = distinct !DICompileUnit(sourceLanguageName: DW_LNAME_C_plus_plus, sourceLanguageVersion: 202002, file: !6, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !5, splitDebugInlining: false, nameTableKind: None, dialect: DW_LLVM_LANG_DIALECT_tile)
|
|
!2 = !{i32 7, !"Dwarf Version", i32 5}
|
|
!3 = !{i32 2, !"Debug Info Version", i32 3}
|
|
!4 = !DIFile(filename: "cu.cpp", directory: "/tmp")
|
|
!5 = !{}
|
|
!6 = !DIFile(filename: "cu2.cpp", directory: "/tmp")
|