1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck %s
4 ; This test makes sure that we do not include debug statements in outlined
7 define void @outline_dbg1() {
8 ; CHECK-LABEL: @outline_dbg1(
10 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
11 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
12 ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4
13 ; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])
14 ; CHECK-NEXT: ret void
17 %a = alloca i32, align 4
18 %b = alloca i32, align 4
19 %c = alloca i32, align 4
20 store i32 2, ptr %a, align 4
21 store i32 3, ptr %b, align 4
22 call void @llvm.dbg.value(metadata i64 0, metadata !14, metadata !DIExpression()), !dbg !14
23 store i32 4, ptr %c, align 4
24 %al = load i32, ptr %a
25 %bl = load i32, ptr %b
26 %cl = load i32, ptr %c
30 declare void @llvm.dbg.value(metadata, metadata, metadata)
32 define void @outline_dbg2() {
33 ; CHECK-LABEL: @outline_dbg2(
35 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
36 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
37 ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4
38 ; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])
39 ; CHECK-NEXT: ret void
42 %a = alloca i32, align 4
43 %b = alloca i32, align 4
44 %c = alloca i32, align 4
45 store i32 2, ptr %a, align 4
46 store i32 3, ptr %b, align 4
47 store i32 4, ptr %c, align 4
48 %al = load i32, ptr %a
49 %bl = load i32, ptr %b
50 %cl = load i32, ptr %c
54 ; CHECK: entry_to_outline:
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)
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)
64 !14 = !DILocalVariable(name: "p_6", arg: 1, scope: !11, line: 117, type: !1)