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 3 4; Make sure that we strip loop debug info from instructions that are outlined as 5; well as regular debug info. 6 7define void @ham(i64 %arg0, i64 %arg1) !dbg !1 { 8bb0: 9 br label %bb1 10bb1: 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 14 15bb2: 16 ret void 17} 18 19define void @wombat(i64 %arg0, i64 %arg1) !dbg !13 { 20bb0: 21 br label %bb1 22bb1: 23 %phi = phi i64 [ 0, %bb0 ], [ %arg1, %bb1 ] 24 %icmp = icmp ult i64 %phi, %arg0 25 br i1 %icmp, label %bb1, label %bb2 26 27bb2: 28 ret void 29} 30 31!llvm.module.flags = !{!0} 32!llvm.dbg.cu = !{} 33 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) 38!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") 50 51; CHECK-LABEL: @ham( 52; CHECK-NEXT: bb0: 53; CHECK-NEXT: call void @outlined_ir_func_0(i64 [[ARG1:%.*]], i64 [[ARG0:%.*]]), !dbg [[DBG6:![0-9]+]] 54; CHECK-NEXT: br label [[BB2:%.*]] 55; CHECK: bb2: 56; CHECK-NEXT: ret void 57; 58; 59; CHECK-LABEL: @wombat( 60; CHECK-NEXT: bb0: 61; CHECK-NEXT: call void @outlined_ir_func_0(i64 [[ARG1:%.*]], i64 [[ARG0:%.*]]), !dbg [[DBG10:![0-9]+]] 62; CHECK-NEXT: br label [[BB2:%.*]] 63; CHECK: bb2: 64; CHECK-NEXT: ret void 65; 66; 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:%.*]] 72; CHECK: 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 78; 79