2017-07-12 01:11:54 +08:00
|
|
|
; RUN: llc -march=hexagon < %s | FileCheck %s
|
|
|
|
;
|
|
|
|
; Check that this testcase does not crash.
|
|
|
|
; CHECK: jumpr r31
|
|
|
|
|
|
|
|
target triple = "hexagon"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
|
|
|
declare i32 @foo0(i32*, i32, i64, i32, i8 zeroext, i8 zeroext, i32) local_unnamed_addr #0
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
|
|
|
define i32 @foo1(i32* %a0, i32 %a1, i32 %a2, i32 %a3, i8 zeroext %a4, i8 zeroext %a5, i32 %a6) local_unnamed_addr #0 !dbg !33 {
|
|
|
|
entry:
|
|
|
|
tail call void @llvm.dbg.value(metadata i32 %a6, i64 0, metadata !51, metadata !52), !dbg !53
|
|
|
|
ret i32 undef, !dbg !54
|
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind readnone speculatable
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
|
|
|
|
|
2017-10-19 02:07:07 +08:00
|
|
|
attributes #0 = { nounwind "disable-tail-calls"="true" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv5" "target-features"="-hvx,-long-calls" }
|
2017-07-12 01:11:54 +08:00
|
|
|
attributes #1 = { nounwind readnone speculatable }
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
|
|
|
!llvm.module.flags = !{!26, !27}
|
|
|
|
!llvm.linker.options = !{!29, !30, !31, !32, !29, !30, !31, !32}
|
|
|
|
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "Clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !22)
|
|
|
|
!1 = !DIFile(filename: "foo.i", directory: "/path")
|
|
|
|
!2 = !{!3, !16}
|
|
|
|
!3 = !DICompositeType(tag: DW_TAG_enumeration_type, file: !4, line: 122, size: 8, elements: !5)
|
|
|
|
!4 = !DIFile(filename: "foo.h", directory: "/path")
|
|
|
|
!5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14, !15}
|
|
|
|
!6 = !DIEnumerator(name: "E0", value: 7)
|
|
|
|
!7 = !DIEnumerator(name: "E1", value: 6)
|
|
|
|
!8 = !DIEnumerator(name: "E2", value: 5)
|
|
|
|
!9 = !DIEnumerator(name: "E3", value: 0)
|
|
|
|
!10 = !DIEnumerator(name: "E4", value: 1)
|
|
|
|
!11 = !DIEnumerator(name: "E5", value: 7)
|
|
|
|
!12 = !DIEnumerator(name: "E6", value: 5)
|
|
|
|
!13 = !DIEnumerator(name: "E7", value: 4)
|
|
|
|
!14 = !DIEnumerator(name: "E8", value: 4)
|
|
|
|
!15 = !DIEnumerator(name: "E9", value: 10)
|
|
|
|
!16 = !DICompositeType(tag: DW_TAG_enumeration_type, file: !4, line: 136, size: 8, elements: !17)
|
|
|
|
!17 = !{!18, !19, !20, !21}
|
|
|
|
!18 = !DIEnumerator(name: "F0", value: 1)
|
|
|
|
!19 = !DIEnumerator(name: "F1", value: 2)
|
|
|
|
!20 = !DIEnumerator(name: "F2", value: 4)
|
|
|
|
!21 = !DIEnumerator(name: "F3", value: 7)
|
|
|
|
!22 = !{!23, !24, !25}
|
|
|
|
!23 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
|
|
|
|
!24 = !DIBasicType(name: "long long unsigned int", size: 64, encoding: DW_ATE_unsigned)
|
|
|
|
!25 = !DIDerivedType(tag: DW_TAG_typedef, name: "t0_t", file: !4, line: 38, baseType: !24)
|
|
|
|
!26 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!27 = !{i32 6, !"Linker Options", !28}
|
|
|
|
!28 = !{!29, !30, !31, !32}
|
|
|
|
!29 = !{!"foo0", !".text"}
|
|
|
|
!30 = !{!"foo1", !".text"}
|
|
|
|
!31 = !{!"foo2", !".text"}
|
|
|
|
!32 = !{!"foo3", !".text"}
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!33 = distinct !DISubprogram(name: "foo1", scope: !34, file: !34, line: 84, type: !35, isLocal: false, isDefinition: true, scopeLine: 85, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !44)
|
2017-07-12 01:11:54 +08:00
|
|
|
!34 = !DIFile(filename: "foo.c", directory: "/path")
|
|
|
|
!35 = !DISubroutineType(types: !36)
|
|
|
|
!36 = !{!37, !38, !39, !40, !41, !42, !43, !37}
|
|
|
|
!37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
|
|
!38 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !23, size: 32)
|
|
|
|
!39 = !DIDerivedType(tag: DW_TAG_typedef, name: "t1_t", file: !4, line: 35, baseType: !23)
|
|
|
|
!40 = !DIDerivedType(tag: DW_TAG_typedef, name: "t2_t", file: !4, line: 36, baseType: !23)
|
|
|
|
!41 = !DIDerivedType(tag: DW_TAG_typedef, name: "t3_t", file: !4, line: 43, baseType: !23)
|
|
|
|
!42 = !DIDerivedType(tag: DW_TAG_typedef, name: "t4_t", file: !4, line: 133, baseType: !3)
|
|
|
|
!43 = !DIDerivedType(tag: DW_TAG_typedef, name: "t5_t", file: !4, line: 141, baseType: !16)
|
|
|
|
!44 = !{!45, !46, !47, !48, !49, !50, !51}
|
|
|
|
!45 = !DILocalVariable(name: "a0", arg: 1, scope: !33, file: !34, line: 84, type: !38)
|
|
|
|
!46 = !DILocalVariable(name: "a1", arg: 2, scope: !33, file: !34, line: 84, type: !39)
|
|
|
|
!47 = !DILocalVariable(name: "a2", arg: 3, scope: !33, file: !34, line: 84, type: !40)
|
|
|
|
!48 = !DILocalVariable(name: "a3", arg: 4, scope: !33, file: !34, line: 84, type: !41)
|
|
|
|
!49 = !DILocalVariable(name: "a4", arg: 5, scope: !33, file: !34, line: 84, type: !42)
|
|
|
|
!50 = !DILocalVariable(name: "a5", arg: 6, scope: !33, file: !34, line: 84, type: !43)
|
|
|
|
!51 = !DILocalVariable(name: "a6", arg: 7, scope: !33, file: !34, line: 84, type: !37)
|
|
|
|
!52 = !DIExpression()
|
|
|
|
!53 = !DILocation(line: 84, column: 169, scope: !33)
|
|
|
|
!54 = !DILocation(line: 86, column: 5, scope: !33)
|