llvm / llvm/llvm-project

AArch64 Scalable vector debug info crash

Open
#161,289 6 comments 0 reactions 0 assignees View on GitHub
backend:AArch64 crash debuginfo SVE
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

See https://godbolt.org/z/9dKMr7vT6

```
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-gnu"

define @scalable_vector_debug_info( %arg) #0 !dbg !7 {
; CHECK-LABEL: scalable_vector_debug_info:
; CHECK: .Lfunc_begin0:
; CHECK-NEXT: .cfi_startproc
; CHECK-NEXT: // %bb.0:
; CHECK-NEXT: //DEBUG_VALUE: scalable_vector_debug_info:arg <- $z0
; CHECK-NEXT: ret
#dbg_value( %arg, !13, !DIExpression(), !14)
%extract = tail call @llvm.vector.extract.nxv8f16.nxv16f16( %arg, i64 0)
ret %arg
}

declare @llvm.vector.extract.nxv8f16.nxv16f16(, i64 immarg)

attributes #0 = { "aarch64_pstate_sm_enabled" "target-features"="+sme" }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "scalable-vector-debug.c", directory: "/tmp")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{i32 7, !"frame-pointer", i32 2}
!7 = distinct !DISubprogram(name: "scalable_vector_debug_info", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12)
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !10}
!10 = !DIBasicType(name: "svfloat16_t", size: 16, encoding: DW_ATE_float)
!11 = !DIBasicType(name: "__fp16", size: 16, encoding: DW_ATE_float)
!12 = !{!13}
!13 = !DILocalVariable(name: "arg", arg: 1, scope: !7, file: !1, line: 1, type: !10)
!14 = !DILocation(line: 0, scope: !7)
!15 = distinct !DISubprogram(name: "streaming_sve_debug_info", scope: !1, file: !1, line: 5, type: !8, scopeLine: 5, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !18)
!16 = !DILocalVariable(name: "arg", arg: 1, scope: !15, file: !1, line: 5, type: !10)
!17 = !DILocation(line: 0, scope: !15)
!18 = !{!16}
```

Compiling with `llc -mtriple aarch64 -mattr=+sme` triggers:
`LLVM ERROR: Cannot implicitly convert a scalable size to a fixed-width size in TypeSize::operator ScalarTy()`

Contributor guide

Open the contributing guide

Research direction

Start with the godbolt reproducer and run the shown llc -mtriple aarch64 -mattr=+sme command to reproduce the TypeSize conversion error. Trace the scalable-vector debug-info path around the reported failure, then verify that compilation completes and produces the expected CHECK debug output without the crash.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.