1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
# Check that the codegenprepare succeeds in dupRetToEnableTailCallOpts() also
# in the presence of a call to @llvm.dbg.value()
#
# RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=z13 -start-before=codegenprepare \
# RUN: -stop-after codegenprepare -o - | FileCheck %s
#
# CHECK-LABEL: bb1:
# CHECK: ret
# CHECK-LABEL: bb2:
# CHECK: ret
# Generated with:
#
# bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 -stop-before codegenprepare -simplify-mir
#
# %0 = type { i32 (...)**, i16, %1* }
# %1 = type { i32 (...)** }
# %2 = type { i32 (...)**, %1*, i8, i32, i32, i32, i16, i32, i16, i32, i16*, %3*, %6*, %9 }
# %3 = type { %4 }
# %4 = type { i32 (...)**, i8, i32, i32, %5**, %1* }
# %5 = type { i32, i32 }
# %6 = type { %7*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %1* }
# %7 = type { %8 }
# %8 = type { i32 (...)**, i8, i32, i32, %0**, %1* }
# %9 = type { i8* }
# %10 = type { %0, i32, i32, %0* }
#
# define %0* @Fun(%2* %arg) !dbg !7 {
# bb:
# switch i32 undef, label %bb3 [
# i32 58, label %bb1
# i32 41, label %bb2
# ], !dbg !14
#
# bb1: ; preds = %bb
# br label %bb4, !dbg !15
#
# bb2: ; preds = %bb
# %tmp = tail call %10* @hoge(%6* undef, %0* undef, i32 signext 0, i32 signext 0), !dbg !16
# call void @llvm.dbg.value(metadata %10* %tmp, metadata !10, metadata !DIExpression()), !dbg !16
# br label %bb4, !dbg !17
#
# bb3: ; preds = %bb
# unreachable, !dbg !18
#
# bb4: ; preds = %bb2, %bb1
# %tmp5 = phi %10* [ undef, %bb1 ], [ %tmp, %bb2 ], !dbg !19
# call void @llvm.dbg.value(metadata %10* %tmp5, metadata !12, metadata !DIExpression()), !dbg !19
# %tmp6 = bitcast %10* %tmp5 to %0*, !dbg !20
# call void @llvm.dbg.value(metadata %0* %tmp6, metadata !13, metadata !DIExpression()), !dbg !20
# ret %0* %tmp6, !dbg !21
# }
#
# declare %10* @hoge(%6*, %0*, i32, i32)
#
# ; Function Attrs: nounwind readnone speculatable
# declare void @llvm.dbg.value(metadata, metadata, metadata) #1
#
# attributes #0 = { "use-soft-float"="false" }
# attributes #1 = { nounwind readnone speculatable }
#
# !llvm.module.flags = !{!0, !1}
# !llvm.dbg.cu = !{!2}
# !llvm.debugify = !{!5, !6}
#
# !0 = !{i32 2, !"Debug Info Version", i32 3}
# !1 = !{i32 1, !"wchar_size", i32 4}
# !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)
# !3 = !DIFile(filename: "tc.ll", directory: "/")
# !4 = !{}
# !5 = !{i32 8}
# !6 = !{i32 3}
# !7 = distinct !DISubprogram(name: "eggs", linkageName: "eggs", scope: null, file: !3, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !9)
# !8 = !DISubroutineType(types: !4)
# !9 = !{!10, !12, !13}
# !10 = !DILocalVariable(name: "1", scope: !7, file: !3, line: 3, type: !11)
# !11 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)
# !12 = !DILocalVariable(name: "2", scope: !7, file: !3, line: 6, type: !11)
# !13 = !DILocalVariable(name: "3", scope: !7, file: !3, line: 7, type: !11)
# !14 = !DILocation(line: 1, column: 1, scope: !7)
# !15 = !DILocation(line: 2, column: 1, scope: !7)
# !16 = !DILocation(line: 3, column: 1, scope: !7)
# !17 = !DILocation(line: 4, column: 1, scope: !7)
# !18 = !DILocation(line: 5, column: 1, scope: !7)
# !19 = !DILocation(line: 6, column: 1, scope: !7)
# !20 = !DILocation(line: 7, column: 1, scope: !7)
# !21 = !DILocation(line: 8, column: 1, scope: !7)
--- |
%0 = type { i32 (...)**, i16, %1* }
%1 = type { i32 (...)** }
%2 = type { i32 (...)**, %1*, i8, i32, i32, i32, i16, i32, i16, i32, i16*, %3*, %6*, %9 }
%3 = type { %4 }
%4 = type { i32 (...)**, i8, i32, i32, %5**, %1* }
%5 = type { i32, i32 }
%6 = type { %7*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %0*, %1* }
%7 = type { %8 }
%8 = type { i32 (...)**, i8, i32, i32, %0**, %1* }
%9 = type { i8* }
%10 = type { %0, i32, i32, %0* }
define %0* @Fun(%2* %arg) #0 !dbg !7 {
bb:
switch i32 undef, label %bb3 [
i32 58, label %bb1
i32 41, label %bb2
], !dbg !14
bb1: ; preds = %bb
br label %bb4, !dbg !15
bb2: ; preds = %bb
%tmp = tail call %10* @hoge(%6* undef, %0* undef, i32 signext 0, i32 signext 0), !dbg !16
call void @llvm.dbg.value(metadata %10* %tmp, metadata !10, metadata !DIExpression()), !dbg !16
br label %bb4, !dbg !17
bb3: ; preds = %bb
unreachable, !dbg !18
bb4: ; preds = %bb2, %bb1
%tmp5 = phi %10* [ undef, %bb1 ], [ %tmp, %bb2 ], !dbg !19
call void @llvm.dbg.value(metadata %10* %tmp5, metadata !12, metadata !DIExpression()), !dbg !19
%tmp6 = bitcast %10* %tmp5 to %0*, !dbg !20
call void @llvm.dbg.value(metadata %0* %tmp6, metadata !13, metadata !DIExpression()), !dbg !20
ret %0* %tmp6, !dbg !21
}
declare %10* @hoge(%6*, %0*, i32, i32) #0
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
attributes #0 = { "target-cpu"="z13" }
attributes #1 = { nounwind readnone speculatable "target-cpu"="z13" }
!llvm.module.flags = !{!0, !1}
!llvm.dbg.cu = !{!2}
!llvm.debugify = !{!5, !6}
!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)
!3 = !DIFile(filename: "tc.ll", directory: "/")
!4 = !{}
!5 = !{i32 8}
!6 = !{i32 3}
!7 = distinct !DISubprogram(name: "eggs", linkageName: "eggs", scope: null, file: !3, line: 1, type: !8, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !9)
!8 = !DISubroutineType(types: !4)
!9 = !{!10, !12, !13}
!10 = !DILocalVariable(name: "1", scope: !7, file: !3, line: 3, type: !11)
!11 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)
!12 = !DILocalVariable(name: "2", scope: !7, file: !3, line: 6, type: !11)
!13 = !DILocalVariable(name: "3", scope: !7, file: !3, line: 7, type: !11)
!14 = !DILocation(line: 1, column: 1, scope: !7)
!15 = !DILocation(line: 2, column: 1, scope: !7)
!16 = !DILocation(line: 3, column: 1, scope: !7)
!17 = !DILocation(line: 4, column: 1, scope: !7)
!18 = !DILocation(line: 5, column: 1, scope: !7)
!19 = !DILocation(line: 6, column: 1, scope: !7)
!20 = !DILocation(line: 7, column: 1, scope: !7)
!21 = !DILocation(line: 8, column: 1, scope: !7)
...
---
name: Fun
alignment: 16
tracksRegLiveness: true
...
|