brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · ad45d1e Raw
49 lines · plain
1; RUN: opt -passes=instcombine -S < %s | FileCheck %s2 3; CHECK-LABEL: define {{.*}} @test54define i16 @test5(i16 %A) !dbg !34 {5  ; CHECK: [[and:%.*]] = and i16 %A, 156 7  %B = sext i16 %A to i32, !dbg !408  call void @llvm.dbg.value(metadata i32 %B, metadata !36, metadata !DIExpression()), !dbg !409 10  %C = and i32 %B, 15, !dbg !4111  call void @llvm.dbg.value(metadata i32 %C, metadata !37, metadata !DIExpression()), !dbg !4112 13  ; Preserve the dbg.value for the DCE'd 32-bit 'and'.14  ; CHECK-NEXT: #dbg_value(i16 [[and]], [[C:![0-9]+]],15  ; CHECK-SAME:    !DIExpression(DW_OP_LLVM_convert, 16, DW_ATE_unsigned, DW_OP_LLVM_convert, 32, DW_ATE_unsigned, DW_OP_stack_value)16 17  %D = trunc i32 %C to i16, !dbg !4218  call void @llvm.dbg.value(metadata i16 %D, metadata !38, metadata !DIExpression()), !dbg !4219 20  ; The dbg.value for a truncate should simply point to the result of the 16-bit 'and'.21  ; CHECK-NEXT: #dbg_value(i16 [[and]], [[D:![0-9]+]], !DIExpression(),22 23  ret i16 %D, !dbg !4324  ; CHECK-NEXT: ret i16 [[and]]25}26 27declare void @llvm.dbg.value(metadata, metadata, metadata)28 29!llvm.dbg.cu = !{!0}30!llvm.module.flags = !{!5}31 32!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)33!1 = !DIFile(filename: "void", directory: "/")34!2 = !{}35!5 = !{i32 2, !"Debug Info Version", i32 3}36!7 = !DISubroutineType(types: !2)37!10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_signed)38!12 = !DIBasicType(name: "ty8", size: 8, encoding: DW_ATE_signed)39!34 = distinct !DISubprogram(name: "test5", linkageName: "test5", scope: null, file: !1, line: 12, type: !7, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: true, unit: !0, retainedNodes: !35)40!35 = !{!36, !37, !38}41!36 = !DILocalVariable(name: "B", scope: !34, file: !1, line: 12, type: !10)42!37 = !DILocalVariable(name: "C", scope: !34, file: !1, line: 13, type: !10)43!38 = !DILocalVariable(name: "D", scope: !34, file: !1, line: 14, type: !39)44!39 = !DIBasicType(name: "ty16", size: 16, encoding: DW_ATE_signed)45!40 = !DILocation(line: 12, column: 1, scope: !34)46!41 = !DILocation(line: 13, column: 1, scope: !34)47!42 = !DILocation(line: 14, column: 1, scope: !34)48!43 = !DILocation(line: 15, column: 1, scope: !34)49