brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.4 KiB · 168232e Raw
163 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --include-generated-funcs2; RUN: opt -passes=verify,iroutliner -ir-outlining-no-cost < %s | \3; RUN: llc -filetype=obj -mtriple=aarch64-- | llvm-dwarfdump - | FileCheck %s4 5; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck -check-prefix=IRDEBUG %s6 7; Ensure that the IR Outliner produces valid DWARF debug information when8; creating outlined functions.9 10; CHECK: DW_TAG_compile_unit11; CHECK-DAG: DW_AT_name ("outline_debug1")12 13; Check the high address of bar. This is one past the end of bar. It should be14; the beginning of the outlined function.15; CHECK:      DW_AT_high_pc ([[ONE_PAST_BAR:0x[a-f0-9]+]])16; CHECK-NEXT: DW_AT_frame_base  (DW_OP_reg31 WSP)17; CHECK-NEXT: DW_AT_linkage_name  ("outline_debug2")18; CHECK-NEXT: DW_AT_name  ("outline_debug2")19 20; Check the outlined function's DWARF.21; CHECK-DAG:  DW_TAG_subprogram22; CHECK-NEXT: DW_AT_low_pc  ([[ONE_PAST_BAR]])23; CHECK-NEXT: DW_AT_high_pc (0x{{[0-9a-f]+}})24; CHECK-NEXT: DW_AT_frame_base  (DW_OP_reg31 WSP)25; CHECK-NEXT: DW_AT_linkage_name ("[[NAME:outlined_ir_func_[0-9]+]]")26; CHECK-NEXT: DW_AT_name  ("[[NAME]]")27; CHECK-NEXT: DW_AT_artificial  (true)28; CHECK-NEXT: DW_AT_external  (true)29 30define void @outline_debug1() !dbg !6 {31entry:32  %a = alloca i32, align 4, !dbg !1733  call void @llvm.dbg.value(metadata ptr %a, metadata !9, metadata !DIExpression()), !dbg !1734  %b = alloca i32, align 4, !dbg !1835  call void @llvm.dbg.value(metadata ptr %b, metadata !11, metadata !DIExpression()), !dbg !1836  %c = alloca i32, align 4, !dbg !1937  call void @llvm.dbg.value(metadata ptr %c, metadata !12, metadata !DIExpression()), !dbg !1938  store i32 2, ptr %a, align 4, !dbg !2039  store i32 3, ptr %b, align 4, !dbg !2140  store i32 4, ptr %c, align 4, !dbg !2241  %al = load i32, ptr %a, align 4, !dbg !2342  call void @llvm.dbg.value(metadata i32 %al, metadata !13, metadata !DIExpression()), !dbg !2343  %bl = load i32, ptr %b, align 4, !dbg !2444  call void @llvm.dbg.value(metadata i32 %bl, metadata !15, metadata !DIExpression()), !dbg !2445  %cl = load i32, ptr %c, align 4, !dbg !2546  call void @llvm.dbg.value(metadata i32 %cl, metadata !16, metadata !DIExpression()), !dbg !2547  ret void, !dbg !2648}49 50define void @outline_debug2() !dbg !27 {51entry:52  %a = alloca i32, align 4, !dbg !3553  call void @llvm.dbg.value(metadata ptr %a, metadata !29, metadata !DIExpression()), !dbg !3554  %b = alloca i32, align 4, !dbg !3655  call void @llvm.dbg.value(metadata ptr %b, metadata !30, metadata !DIExpression()), !dbg !3656  %c = alloca i32, align 4, !dbg !3757  call void @llvm.dbg.value(metadata ptr %c, metadata !31, metadata !DIExpression()), !dbg !3758  store i32 2, ptr %a, align 4, !dbg !3859  store i32 3, ptr %b, align 4, !dbg !3960  store i32 4, ptr %c, align 4, !dbg !4061  %al = load i32, ptr %a, align 4, !dbg !4162  call void @llvm.dbg.value(metadata i32 %al, metadata !32, metadata !DIExpression()), !dbg !4163  %bl = load i32, ptr %b, align 4, !dbg !4264  call void @llvm.dbg.value(metadata i32 %bl, metadata !33, metadata !DIExpression()), !dbg !4265  %cl = load i32, ptr %c, align 4, !dbg !4366  call void @llvm.dbg.value(metadata i32 %cl, metadata !34, metadata !DIExpression()), !dbg !4367  ret void, !dbg !4468}69 70; Function Attrs: nounwind readnone speculatable willreturn71declare void @llvm.dbg.value(metadata, metadata, metadata) #072 73attributes #0 = { nounwind readnone speculatable willreturn }74 75!llvm.dbg.cu = !{!0}76!llvm.debugify = !{!3, !4}77!llvm.module.flags = !{!5}78 79!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)80!1 = !DIFile(filename: "llvm/test/DebugInfo/ir-outliner.ll", directory: "/")81!2 = !{}82!3 = !{i32 20}83!4 = !{i32 12}84!5 = !{i32 2, !"Debug Info Version", i32 3}85!6 = distinct !DISubprogram(name: "outline_debug1", linkageName: "outline_debug1", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)86!7 = !DISubroutineType(types: !2)87!8 = !{!9, !11, !12, !13, !15, !16}88!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)89!10 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)90!11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 2, type: !10)91!12 = !DILocalVariable(name: "3", scope: !6, file: !1, line: 3, type: !10)92!13 = !DILocalVariable(name: "4", scope: !6, file: !1, line: 7, type: !14)93!14 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)94!15 = !DILocalVariable(name: "5", scope: !6, file: !1, line: 8, type: !14)95!16 = !DILocalVariable(name: "6", scope: !6, file: !1, line: 9, type: !14)96!17 = !DILocation(line: 1, column: 1, scope: !6)97!18 = !DILocation(line: 2, column: 1, scope: !6)98!19 = !DILocation(line: 3, column: 1, scope: !6)99!20 = !DILocation(line: 4, column: 1, scope: !6)100!21 = !DILocation(line: 5, column: 1, scope: !6)101!22 = !DILocation(line: 6, column: 1, scope: !6)102!23 = !DILocation(line: 7, column: 1, scope: !6)103!24 = !DILocation(line: 8, column: 1, scope: !6)104!25 = !DILocation(line: 9, column: 1, scope: !6)105!26 = !DILocation(line: 10, column: 1, scope: !6)106!27 = distinct !DISubprogram(name: "outline_debug2", linkageName: "outline_debug2", scope: null, file: !1, line: 11, type: !7, scopeLine: 11, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !28)107!28 = !{!29, !30, !31, !32, !33, !34}108!29 = !DILocalVariable(name: "7", scope: !27, file: !1, line: 11, type: !10)109!30 = !DILocalVariable(name: "8", scope: !27, file: !1, line: 12, type: !10)110!31 = !DILocalVariable(name: "9", scope: !27, file: !1, line: 13, type: !10)111!32 = !DILocalVariable(name: "10", scope: !27, file: !1, line: 17, type: !14)112!33 = !DILocalVariable(name: "11", scope: !27, file: !1, line: 18, type: !14)113!34 = !DILocalVariable(name: "12", scope: !27, file: !1, line: 19, type: !14)114!35 = !DILocation(line: 11, column: 1, scope: !27)115!36 = !DILocation(line: 12, column: 1, scope: !27)116!37 = !DILocation(line: 13, column: 1, scope: !27)117!38 = !DILocation(line: 14, column: 1, scope: !27)118!39 = !DILocation(line: 15, column: 1, scope: !27)119!40 = !DILocation(line: 16, column: 1, scope: !27)120!41 = !DILocation(line: 17, column: 1, scope: !27)121!42 = !DILocation(line: 18, column: 1, scope: !27)122!43 = !DILocation(line: 19, column: 1, scope: !27)123!44 = !DILocation(line: 20, column: 1, scope: !27)124 125; IRDEBUG-LABEL: @outline_debug1(126; IRDEBUG-NEXT:  entry:127; IRDEBUG-NEXT:    [[A:%.*]] = alloca i32, align 4, !dbg [[DBG17:![0-9]+]]128; IRDEBUG-NEXT:      #dbg_value(ptr [[A]], [[META9:![0-9]+]], !DIExpression(), [[DBG17]])129; IRDEBUG-NEXT:    [[B:%.*]] = alloca i32, align 4, !dbg [[DBG18:![0-9]+]]130; IRDEBUG-NEXT:      #dbg_value(ptr [[B]], [[META11:![0-9]+]], !DIExpression(), [[DBG18]])131; IRDEBUG-NEXT:    [[C:%.*]] = alloca i32, align 4, !dbg [[DBG19:![0-9]+]]132; IRDEBUG-NEXT:      #dbg_value(ptr [[C]], [[META12:![0-9]+]], !DIExpression(), [[DBG19]])133; IRDEBUG-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]]), !dbg [[DBG20:![0-9]+]]134; IRDEBUG-NEXT:    ret void, !dbg [[DBG21:![0-9]+]]135;136;137; IRDEBUG-LABEL: @outline_debug2(138; IRDEBUG-NEXT:  entry:139; IRDEBUG-NEXT:    [[A:%.*]] = alloca i32, align 4, !dbg [[DBG30:![0-9]+]]140; IRDEBUG-NEXT:      #dbg_value(ptr [[A]], [[META24:![0-9]+]], !DIExpression(), [[DBG30]])141; IRDEBUG-NEXT:    [[B:%.*]] = alloca i32, align 4, !dbg [[DBG31:![0-9]+]]142; IRDEBUG-NEXT:      #dbg_value(ptr [[B]], [[META25:![0-9]+]], !DIExpression(), [[DBG31]])143; IRDEBUG-NEXT:    [[C:%.*]] = alloca i32, align 4, !dbg [[DBG32:![0-9]+]]144; IRDEBUG-NEXT:      #dbg_value(ptr [[C]], [[META26:![0-9]+]], !DIExpression(), [[DBG32]])145; IRDEBUG-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]]), !dbg [[DBG33:![0-9]+]]146; IRDEBUG-NEXT:    ret void, !dbg [[DBG34:![0-9]+]]147;148;149; IRDEBUG-LABEL: define {{.+}} @outlined_ir_func_0(150; IRDEBUG-NEXT:  newFuncRoot:151; IRDEBUG-NEXT:    br label [[ENTRY_TO_OUTLINE:%.*]]152; IRDEBUG:       entry_to_outline:153; IRDEBUG-NEXT:    store i32 2, ptr [[TMP0:%.*]], align 4154; IRDEBUG-NEXT:    store i32 3, ptr [[TMP1:%.*]], align 4155; IRDEBUG-NEXT:    store i32 4, ptr [[TMP2:%.*]], align 4156; IRDEBUG-NEXT:    [[AL:%.*]] = load i32, ptr [[TMP0]], align 4157; IRDEBUG-NEXT:    [[BL:%.*]] = load i32, ptr [[TMP1]], align 4158; IRDEBUG-NEXT:    [[CL:%.*]] = load i32, ptr [[TMP2]], align 4159; IRDEBUG-NEXT:    br label [[ENTRY_AFTER_OUTLINE_EXITSTUB:%.*]]160; IRDEBUG:       entry_after_outline.exitStub:161; IRDEBUG-NEXT:    ret void162;163