brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.7 KiB · bc7e016 Raw
172 lines · plain
1# Check that the codegenprepare succeeds in dupRetToEnableTailCallOpts() also2# in the presence of a call to @llvm.dbg.value()3#4# RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=z13 -start-before=codegenprepare \5# RUN:   -stop-after codegenprepare -o - | FileCheck %s6#7# CHECK-LABEL: bb1:8# CHECK:       ret9# CHECK-LABEL: bb2:10# CHECK:       ret11 12 13# Generated with:14#15# bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 -stop-before codegenprepare -simplify-mir16#17# %0 = type { i32 (...)**, i16, %1* }18# %1 = type { i32 (...)** }19# %2 = type { i32 (...)**, %1*, i8, i32, i32, i32, i16, i32, i16, i32, i16*, %3*, %6*, %9 }20# %3 = type { %4 }21# %4 = type { i32 (...)**, i8, i32, i32, %5**, %1* }22# %5 = type { i32, i32 }23# %6 = type { %7*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %1* }24# %7 = type { %8 }25# %8 = type { i32 (...)**, i8, i32, i32, %0**, %1* }26# %9 = type { i8* }27# %10 = type { %0, i32, i32, %0* }28#29# define %0* @Fun(%2* %arg) !dbg !7 {30# bb:31#   switch i32 undef, label %bb3 [32#     i32 58, label %bb133#     i32 41, label %bb234#   ], !dbg !1435#36# bb1:                                              ; preds = %bb37#   br label %bb4, !dbg !1538#39# bb2:                                              ; preds = %bb40#   %tmp = tail call %10* @hoge(%6* undef, %0* undef, i32 signext 0, i32 signext 0), !dbg !1641#   call void @llvm.dbg.value(metadata %10* %tmp, metadata !10, metadata !DIExpression()), !dbg !1642#   br label %bb4, !dbg !1743#44# bb3:                                              ; preds = %bb45#   unreachable, !dbg !1846#47# bb4:                                              ; preds = %bb2, %bb148#   %tmp5 = phi %10* [ undef, %bb1 ], [ %tmp, %bb2 ], !dbg !1949#   call void @llvm.dbg.value(metadata %10* %tmp5, metadata !12, metadata !DIExpression()), !dbg !1950#   %tmp6 = bitcast %10* %tmp5 to %0*, !dbg !2051#   call void @llvm.dbg.value(metadata %0* %tmp6, metadata !13, metadata !DIExpression()), !dbg !2052#   ret %0* %tmp6, !dbg !2153# }54#55# declare %10* @hoge(%6*, %0*, i32, i32)56#57# ; Function Attrs: nounwind readnone speculatable58# declare void @llvm.dbg.value(metadata, metadata, metadata) #159#60# attributes #0 = { "use-soft-float"="false" }61# attributes #1 = { nounwind readnone speculatable }62#63# !llvm.module.flags = !{!0, !1}64# !llvm.dbg.cu = !{!2}65# !llvm.debugify = !{!5, !6}66#67# !0 = !{i32 2, !"Debug Info Version", i32 3}68# !1 = !{i32 1, !"wchar_size", i32 4}69# !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)70# !3 = !DIFile(filename: "tc.ll", directory: "/")71# !4 = !{}72# !5 = !{i32 8}73# !6 = !{i32 3}74# !7 = distinct !DISubprogram(name: "eggs", linkageName: "eggs", scope: null, file: !3, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !9)75# !8 = !DISubroutineType(types: !4)76# !9 = !{!10, !12, !13}77# !10 = !DILocalVariable(name: "1", scope: !7, file: !3, line: 3, type: !11)78# !11 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)79# !12 = !DILocalVariable(name: "2", scope: !7, file: !3, line: 6, type: !11)80# !13 = !DILocalVariable(name: "3", scope: !7, file: !3, line: 7, type: !11)81# !14 = !DILocation(line: 1, column: 1, scope: !7)82# !15 = !DILocation(line: 2, column: 1, scope: !7)83# !16 = !DILocation(line: 3, column: 1, scope: !7)84# !17 = !DILocation(line: 4, column: 1, scope: !7)85# !18 = !DILocation(line: 5, column: 1, scope: !7)86# !19 = !DILocation(line: 6, column: 1, scope: !7)87# !20 = !DILocation(line: 7, column: 1, scope: !7)88# !21 = !DILocation(line: 8, column: 1, scope: !7)89 90 91--- |92  93  %0 = type { ptr, i16, ptr }94  %1 = type { ptr }95  %2 = type { ptr, ptr, i8, i32, i32, i32, i16, i32, i16, i32, ptr, ptr, ptr, %9 }96  %3 = type { %4 }97  %4 = type { ptr, i8, i32, i32, ptr, ptr }98  %5 = type { i32, i32 }99  %6 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }100  %7 = type { %8 }101  %8 = type { ptr, i8, i32, i32, ptr, ptr }102  %9 = type { ptr }103  %10 = type { %0, i32, i32, ptr }104  105  define ptr @Fun(ptr %arg) #0 !dbg !7 {106  bb:107    switch i32 undef, label %bb3 [108      i32 58, label %bb1109      i32 41, label %bb2110    ], !dbg !14111  112  bb1:                                              ; preds = %bb113    br label %bb4, !dbg !15114  115  bb2:                                              ; preds = %bb116    %tmp = tail call ptr @hoge(ptr undef, ptr undef, i32 signext 0, i32 signext 0), !dbg !16117    call void @llvm.dbg.value(metadata ptr %tmp, metadata !10, metadata !DIExpression()), !dbg !16118    br label %bb4, !dbg !17119  120  bb3:                                              ; preds = %bb121    unreachable, !dbg !18122  123  bb4:                                              ; preds = %bb2, %bb1124    %tmp5 = phi ptr [ undef, %bb1 ], [ %tmp, %bb2 ], !dbg !19125    call void @llvm.dbg.value(metadata ptr %tmp5, metadata !12, metadata !DIExpression()), !dbg !19126    %tmp6 = bitcast ptr %tmp5 to ptr, !dbg !20127    call void @llvm.dbg.value(metadata ptr %tmp6, metadata !13, metadata !DIExpression()), !dbg !20128    ret ptr %tmp6, !dbg !21129  }130  131  declare ptr @hoge(ptr, ptr, i32, i32) #0132  133  ; Function Attrs: nounwind readnone speculatable134  declare void @llvm.dbg.value(metadata, metadata, metadata) #1135  136  attributes #0 = { "target-cpu"="z13" }137  attributes #1 = { nounwind readnone speculatable "target-cpu"="z13" }138  139  !llvm.module.flags = !{!0, !1}140  !llvm.dbg.cu = !{!2}141  !llvm.debugify = !{!5, !6}142  143  !0 = !{i32 2, !"Debug Info Version", i32 3}144  !1 = !{i32 1, !"wchar_size", i32 4}145  !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)146  !3 = !DIFile(filename: "tc.ll", directory: "/")147  !4 = !{}148  !5 = !{i32 8}149  !6 = !{i32 3}150  !7 = distinct !DISubprogram(name: "eggs", linkageName: "eggs", scope: null, file: !3, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !9)151  !8 = !DISubroutineType(types: !4)152  !9 = !{!10, !12, !13}153  !10 = !DILocalVariable(name: "1", scope: !7, file: !3, line: 3, type: !11)154  !11 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)155  !12 = !DILocalVariable(name: "2", scope: !7, file: !3, line: 6, type: !11)156  !13 = !DILocalVariable(name: "3", scope: !7, file: !3, line: 7, type: !11)157  !14 = !DILocation(line: 1, column: 1, scope: !7)158  !15 = !DILocation(line: 2, column: 1, scope: !7)159  !16 = !DILocation(line: 3, column: 1, scope: !7)160  !17 = !DILocation(line: 4, column: 1, scope: !7)161  !18 = !DILocation(line: 5, column: 1, scope: !7)162  !19 = !DILocation(line: 6, column: 1, scope: !7)163  !20 = !DILocation(line: 7, column: 1, scope: !7)164  !21 = !DILocation(line: 8, column: 1, scope: !7)165 166...167---168name:            Fun169alignment:       16170tracksRegLiveness: true171...172