brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 23eaaca Raw
74 lines · plain
1; RUN: llc -mtriple=x86_64-- %s -o - -O0 -stop-before=finalize-isel \2; RUN:      -experimental-debug-variable-locations \3; RUN:    | FileCheck %s --check-prefix=O0 --implicit-check-not=DBG_INSTR_REF4; RUN: llc -mtriple=x86_64-- %s -o - -O2 -stop-before=finalize-isel \5; RUN:      -experimental-debug-variable-locations \6; RUN:    | FileCheck %s --check-prefix=O2 --implicit-check-not=DBG_VALUE7; RUN: llc -mtriple=x86_64-- %s -o - -stop-before=finalize-isel \8; RUN:      -fast-isel -experimental-debug-variable-locations \9; RUN:    | FileCheck %s --check-prefix=FASTISEL --implicit-check-not=DBG_VALUE10 11; Test that instruction-referencing variable locations are issued at -O2, but12; normal DBG_VALUEs are issued at -O0. This behaviour is desired as the former13; is slow when applied to unoptimized code.14; (Copy + pasted from ./dead-store-elimination-marks-undef.ll),15 16; O0-LABEL: name: main17; O0:       DBG_VALUE18; O0-LABEL: name: fn_optnone19; O0:       DBG_VALUE20 21; O2-LABEL: name: main22; O2:       DBG_INSTR_REF23; O2-LABEL: name: fn_optnone24; O2:       DBG_VALUE25 26; FASTISEL-LABEL: name: main27; FASTISEL:       DBG_INSTR_REF28; FASTISEL-LABEL: name: fn_optnone29; FASTISEL:       DBG_VALUE30 31@b = common dso_local local_unnamed_addr global i32 0, align 132 33define dso_local i32 @main() local_unnamed_addr !dbg !7 {34  %1 = alloca i32, align 435  %2 = load i32, ptr @b, align 1, !dbg !1336  call void @llvm.dbg.value(metadata i32 %2, metadata !12, metadata !DIExpression()), !dbg !1337  store i32 %2, ptr %1, align 4, !dbg !1338  ret i32 0, !dbg !1339}40 41define dso_local i32 @fn_optnone() local_unnamed_addr #0 !dbg !27 {42  %1 = alloca i32, align 443  %2 = load i32, ptr @b, align 1, !dbg !3344  call void @llvm.dbg.value(metadata i32 %2, metadata !32, metadata !DIExpression()), !dbg !3345  store i32 %2, ptr %1, align 4, !dbg !3346  ret i32 0, !dbg !3347}48 49attributes #0 = {optnone noinline}50 51declare void @llvm.dbg.value(metadata, metadata, metadata)52 53!llvm.dbg.cu = !{!0}54!llvm.module.flags = !{!3, !4}55!llvm.ident = !{!6}56 57!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 10.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !2, nameTableKind: None)58!1 = !DIFile(filename: "dead-store-elimination-marks-undef.ll", directory: "/temp/bz45080")59!2 = !{}60!3 = !{i32 2, !"Dwarf Version", i32 4}61!4 = !{i32 2, !"Debug Info Version", i32 3}62!6 = !{!"clang version 10.0.0"}63!7 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)64!8 = !DISubroutineType(types: !9)65!9 = !{!10}66!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)67!11 = !{!12}68!12 = !DILocalVariable(name: "l_2864", scope: !7, file: !1, line: 4, type: !10)69!13 = !DILocation(line: 5, column: 12, scope: !7)70!27 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !31)71!31 = !{!32}72!32 = !DILocalVariable(name: "l_2864", scope: !27, file: !1, line: 4, type: !10)73!33 = !DILocation(line: 5, column: 12, scope: !27)74