1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --include-generated-funcs
2 ; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck %s
4 ; Make sure that we strip loop debug info from instructions that are outlined as
5 ; well as regular debug info.
7 define void @ham(i64 %arg0, i64 %arg1) !dbg !1 {
11 %phi = phi i64 [ 0, %bb0 ], [ %arg1, %bb1 ]
12 %icmp = icmp ult i64 %phi, %arg0
13 br i1 %icmp, label %bb1, label %bb2, !dbg !7, !llvm.loop !11
19 define void @wombat(i64 %arg0, i64 %arg1) !dbg !13 {
23 %phi = phi i64 [ 0, %bb0 ], [ %arg1, %bb1 ]
24 %icmp = icmp ult i64 %phi, %arg0
25 br i1 %icmp, label %bb1, label %bb2
31 !llvm.module.flags = !{!0}
34 !0 = !{i32 2, !"Debug Info Version", i32 3}
35 !1 = distinct !DISubprogram(name: "ham", scope: !2, file: !2, line: 160, type: !3, scopeLine: 161, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !5)
36 !2 = !DIFile(filename: "file", directory: "dir")
37 !3 = !DISubroutineType(types: !4)
39 !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "ver", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None, sysroot: "sysroot", sdk: "sdk")
40 !6 = !DIFile(filename: "file", directory: "dir")
41 !7 = !DILocation(line: 354, column: 13, scope: !8, inlinedAt: !10)
42 !8 = distinct !DISubprogram(name: "baz", scope: !9, file: !9, line: 345, type: !3, scopeLine: 346, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !5)
43 !9 = !DIFile(filename: "file", directory: "dir")
44 !10 = distinct !DILocation(line: 164, column: 15, scope: !1)
45 !11 = distinct !{!11, !7, !12}
46 !12 = !DILocation(line: 355, column: 37, scope: !8, inlinedAt: !10)
47 !13 = distinct !DISubprogram(name: "wombat", scope: !2, file: !2, line: 172, type: !3, scopeLine: 173, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !5)
48 !14 = distinct !DISubprogram(name: "bar", scope: !15, file: !15, line: 219, type: !3, scopeLine: 220, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !5)
49 !15 = !DIFile(filename: "file", directory: "dir")
53 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 [[ARG1:%.*]], i64 [[ARG0:%.*]]), !dbg [[DBG6:![0-9]+]]
54 ; CHECK-NEXT: br label [[BB2:%.*]]
56 ; CHECK-NEXT: ret void
59 ; CHECK-LABEL: @wombat(
61 ; CHECK-NEXT: call void @outlined_ir_func_0(i64 [[ARG1:%.*]], i64 [[ARG0:%.*]]), !dbg [[DBG10:![0-9]+]]
62 ; CHECK-NEXT: br label [[BB2:%.*]]
64 ; CHECK-NEXT: ret void
67 ; CHECK-LABEL: define internal void @outlined_ir_func_0(
68 ; CHECK-NEXT: newFuncRoot:
69 ; CHECK-NEXT: br label [[BB0_TO_OUTLINE:%.*]]
70 ; CHECK: bb0_to_outline:
71 ; CHECK-NEXT: br label [[BB1:%.*]]
73 ; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ 0, [[BB0_TO_OUTLINE]] ], [ [[TMP0:%.*]], [[BB1]] ]
74 ; CHECK-NEXT: [[ICMP:%.*]] = icmp ult i64 [[PHI]], [[TMP1:%.*]]
75 ; CHECK-NEXT: br i1 [[ICMP]], label [[BB1]], label [[BB2_EXITSTUB:%.*]], !llvm.loop [[LOOP12:![0-9]+]]
76 ; CHECK: bb2.exitStub:
77 ; CHECK-NEXT: ret void