brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · ff12509 Raw
82 lines · plain
1; RUN: opt < %s -passes=instcombine -S | FileCheck %s2 3; Make sure to update the debug value after dead code elimination.4; CHECK: %call = call signext i8 @b(i32 6), !dbg !395; CHECK-NEXT: #dbg_value(i8 %call, !30, !DIExpression(DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value), !386 7@e = common local_unnamed_addr global i8 0, align 1, !dbg !08@c = common local_unnamed_addr global i32 0, align 4, !dbg !69@d = common local_unnamed_addr global i32 0, align 4, !dbg !1010 11define signext i8 @b(i32 %f) local_unnamed_addr #0 !dbg !18 {12entry:13  call void @llvm.dbg.value(metadata i32 %f, metadata !22, metadata !DIExpression()), !dbg !2314  %conv = trunc i32 %f to i8, !dbg !2415  ret i8 %conv, !dbg !2516}17 18define i32 @main() local_unnamed_addr #0 !dbg !26 {19entry:20  %0 = load i8, ptr @e, align 1, !dbg !31, !tbaa !3221  %conv = sext i8 %0 to i32, !dbg !3122  store i32 %conv, ptr @c, align 4, !dbg !35, !tbaa !3623  call void @llvm.dbg.value(metadata i32 -1372423381, metadata !30, metadata !DIExpression()), !dbg !3824  %call = call signext i8 @b(i32 6), !dbg !3925  %conv1 = sext i8 %call to i32, !dbg !3926  call void @llvm.dbg.value(metadata i32 %conv1, metadata !30, metadata !DIExpression()), !dbg !3827  %1 = load i32, ptr @d, align 4, !dbg !40, !tbaa !3628  %call2 = call i32 (...) @optimize_me_not(), !dbg !4129  ret i32 0, !dbg !4230}31 32declare i32 @optimize_me_not(...) local_unnamed_addr #133declare void @llvm.dbg.value(metadata, metadata, metadata) #234 35!llvm.dbg.cu = !{!2}36!llvm.module.flags = !{!13, !14, !15, !16}37!llvm.ident = !{!17}38 39!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())40!1 = distinct !DIGlobalVariable(name: "e", scope: !2, file: !3, line: 3, type: !12, isLocal: false, isDefinition: true)41!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 9.0.0 (https://github.com/llvm/llvm-project b306ef12f046353ea5bda4b3b77759e57909a0db)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: GNU)42!3 = !DIFile(filename: "a.c", directory: "/Users/davide/llvm/build/bin")43!4 = !{}44!5 = !{!6, !10, !0}45!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())46!7 = distinct !DIGlobalVariable(name: "c", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)47!8 = !DIDerivedType(tag: DW_TAG_typedef, name: "a", file: !3, line: 1, baseType: !9)48!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)49!10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression())50!11 = distinct !DIGlobalVariable(name: "d", scope: !2, file: !3, line: 2, type: !8, isLocal: false, isDefinition: true)51!12 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)52!13 = !{i32 2, !"Dwarf Version", i32 4}53!14 = !{i32 2, !"Debug Info Version", i32 3}54!15 = !{i32 1, !"wchar_size", i32 4}55!16 = !{i32 7, !"PIC Level", i32 2}56!17 = !{!"clang version 9.0.0 (https://github.com/llvm/llvm-project b306ef12f046353ea5bda4b3b77759e57909a0db)"}57!18 = distinct !DISubprogram(name: "b", scope: !3, file: !3, line: 4, type: !19, scopeLine: 4, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !21)58!19 = !DISubroutineType(types: !20)59!20 = !{!12, !9}60!21 = !{!22}61!22 = !DILocalVariable(name: "f", arg: 1, scope: !18, file: !3, line: 4, type: !9)62!23 = !DILocation(line: 4, column: 9, scope: !18)63!24 = !DILocation(line: 4, column: 21, scope: !18)64!25 = !DILocation(line: 4, column: 14, scope: !18)65!26 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 5, type: !27, scopeLine: 5, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !29)66!27 = !DISubroutineType(types: !28)67!28 = !{!9}68!29 = !{!30}69!30 = !DILocalVariable(name: "l_1499", scope: !26, file: !3, line: 7, type: !8)70!31 = !DILocation(line: 6, column: 7, scope: !26)71!32 = !{!33, !33, i64 0}72!33 = !{!"omnipotent char", !34, i64 0}73!34 = !{!"Simple C/C++ TBAA"}74!35 = !DILocation(line: 6, column: 5, scope: !26)75!36 = !{!37, !37, i64 0}76!37 = !{!"int", !33, i64 0}77!38 = !DILocation(line: 7, column: 5, scope: !26)78!39 = !DILocation(line: 8, column: 12, scope: !26)79!40 = !DILocation(line: 9, column: 11, scope: !26)80!41 = !DILocation(line: 10, column: 3, scope: !26)81!42 = !DILocation(line: 11, column: 1, scope: !26)82