[llvm] [NVPTX] Fixing debug symbols for ptx target emitting (PR #101891)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 18 12:42:28 PDT 2024
jhuber6 wrote:
Messed around with this locally,
```llvm
; RUN: llc -mtriple=nvptx64-nvidia-cuda -mcpu=sm_86 < %s | FileCheck %s
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64-nvidia-cuda -mcpu=sm_86 -verify-machineinstrs | %ptxas-verify %}
; CHECK: .global .align 1 .b8 __func___$kernel
; CHECK: .b64 __func__$kernel
@__func__.kernel = private constant [11 x i8] c"foo_kernel\00", align 1, !dbg !0
define void @kernel() !dbg !18 {
call void @escape(ptr noundef @__func__.kernel), !dbg !21
ret void, !dbg !22
}
declare void @escape(ptr noundef)
!llvm.module.flags = !{!8, !9, !10, !11, !12, !13}
!llvm.dbg.cu = !{!14}
!nvvm.annotations = !{!17}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(scope: null, file: !2, line: 6, type: !3, isLocal: true, isDefinition: true)
!2 = !DIFile(filename: "example.cu", directory: "/app")
!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 88, elements: !6)
!4 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5)
!5 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!6 = !{!7}
!7 = !DISubrange(count: 11)
!8 = !{i32 2, !"SDK Version", [2 x i32] [i32 11, i32 3]}
!9 = !{i32 7, !"Dwarf Version", i32 2}
!10 = !{i32 2, !"Debug Info Version", i32 3}
!11 = !{i32 1, !"wchar_size", i32 4}
!12 = !{i32 4, !"nvvm-reflect-ftz", i32 0}
!13 = !{i32 7, !"frame-pointer", i32 2}
!14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !15, producer: "clang version 20.0.0git (https://github.com/llvm/llvm-project.git 69f76c782b554a004078af6909c19a11e3846415)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !16, splitDebugInlining: false, nameTableKind: None)
!15 = !DIFile(filename: "/app/example.cu", directory: "/app")
!16 = !{!0}
!17 = !{ptr @kernel, !"kernel", i32 1}
!18 = distinct !DISubprogram(name: "foo_kernel", linkageName: "kernel", scope: !2, file: !2, line: 4, type: !19, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !14)
!19 = !DISubroutineType(types: !20)
!20 = !{null}
!21 = !DILocation(line: 6, column: 5, scope: !18)
!22 = !DILocation(line: 7, column: 1, scope: !18)
```
This test didn't seem to have the expected result, as the debug string still had the `.` in it.
https://github.com/llvm/llvm-project/pull/101891
More information about the llvm-commits
mailing list