66 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck %s3 4; This test makes sure that we do not include debug statements in outlined5; functions.6 7define void @outline_dbg1() {8; CHECK-LABEL: @outline_dbg1(9; CHECK-NEXT: entry:10; CHECK-NEXT: [[A:%.*]] = alloca i32, align 411; CHECK-NEXT: [[B:%.*]] = alloca i32, align 412; CHECK-NEXT: [[C:%.*]] = alloca i32, align 413; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])14; CHECK-NEXT: ret void15;16entry:17 %a = alloca i32, align 418 %b = alloca i32, align 419 %c = alloca i32, align 420 store i32 2, ptr %a, align 421 store i32 3, ptr %b, align 422 call void @llvm.dbg.value(metadata i64 0, metadata !14, metadata !DIExpression()), !dbg !1523 store i32 4, ptr %c, align 424 %al = load i32, ptr %a25 %bl = load i32, ptr %b26 %cl = load i32, ptr %c27 ret void28}29 30declare void @llvm.dbg.value(metadata, metadata, metadata)31 32define void @outline_dbg2() {33; CHECK-LABEL: @outline_dbg2(34; CHECK-NEXT: entry:35; CHECK-NEXT: [[A:%.*]] = alloca i32, align 436; CHECK-NEXT: [[B:%.*]] = alloca i32, align 437; CHECK-NEXT: [[C:%.*]] = alloca i32, align 438; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])39; CHECK-NEXT: ret void40;41entry:42 %a = alloca i32, align 443 %b = alloca i32, align 444 %c = alloca i32, align 445 store i32 2, ptr %a, align 446 store i32 3, ptr %b, align 447 store i32 4, ptr %c, align 448 %al = load i32, ptr %a49 %bl = load i32, ptr %b50 %cl = load i32, ptr %c51 ret void52}53 54; CHECK: entry_to_outline:55 56!0 = !DIFile(filename: "foo.c", directory: "/tmp")57!1 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)58!5 = distinct !DICompileUnit(language: DW_LANG_C, file: !0, producer: "My Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, retainedTypes: !6, globals: !7)59!6 = !{}60!7 = !{}61!11 = distinct !DISubprogram(name: "func_5", scope: !0, file: !0, line: 117, type: !12, isLocal: true, isDefinition: true, scopeLine: 118, isOptimized: false, unit: !5, retainedNodes: !6)62!12 = !DISubroutineType(types: !13)63!13 = !{}64!14 = !DILocalVariable(name: "p_6", arg: 1, scope: !11, line: 117, type: !1)65!15 = !DILocation(line: 1, scope: !11)66