52 lines · plain
1; RUN: opt %s -passes=inline -S -o - | FileCheck %s2 3;; Inline `f` into `g`. The inlined assignment store and add should retain4;; their atom info.5 6; CHECK: _Z1gi7; CHECK-NOT: _Z1fi8; CHECK: %add.i = add nsw i32 %mul.i, 1, !dbg [[G1R2:!.*]]9; CHECK-NEXT: store i32 %add.i, ptr %x.i, align 4, !dbg [[G1R1:!.*]]10 11; CHECK: distinct !DISubprogram(name: "g", {{.*}}keyInstructions: true)12; CHECK: [[G1R2]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 2)13; CHECK: [[G1R1]] = !DILocation({{.*}}, atomGroup: 1, atomRank: 1)14 15define hidden void @_Z1fi(i32 noundef %a) !dbg !11 {16entry:17 %a.addr = alloca i32, align 418 %x = alloca i32, align 419 store i32 %a, ptr %a.addr, align 420 %0 = load i32, ptr %a.addr, align 421 %mul = mul nsw i32 %0, 222 %add = add nsw i32 %mul, 1, !dbg !1923 store i32 %add, ptr %x, align 4, !dbg !2024 ret void25}26 27define hidden void @_Z1gi(i32 noundef %b) !dbg !23 {28entry:29 %b.addr = alloca i32, align 430 store i32 %b, ptr %b.addr, align 431 %0 = load i32, ptr %b.addr, align 432 call void @_Z1fi(i32 noundef %0), !dbg !2433 ret void34}35 36!llvm.dbg.cu = !{!0}37!llvm.module.flags = !{!2, !3}38!llvm.ident = !{!10}39 40!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_17, file: !1, producer: "clang version 19.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)41!1 = !DIFile(filename: "test.cpp", directory: "/")42!2 = !{i32 7, !"Dwarf Version", i32 5}43!3 = !{i32 2, !"Debug Info Version", i32 3}44!10 = !{!"clang version 19.0.0"}45!11 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !12, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)46!12 = !DISubroutineType(types: !13)47!13 = !{}48!19 = !DILocation(line: 2, scope: !11, atomGroup: 1, atomRank: 2)49!20 = !DILocation(line: 2, scope: !11, atomGroup: 1, atomRank: 1)50!23 = distinct !DISubprogram(name: "g", scope: !1, file: !1, line: 4, type: !12, scopeLine: 4, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)51!24 = !DILocation(line: 5, scope: !23)52