47 lines · plain
1; RUN: opt -passes=sroa -S %s -o - \2; RUN: | FileCheck %s --implicit-check-not="#dbg_"3 4;; Check that sroa removes redundant debug intrinsics after it makes a5;; change. This has a significant positive impact on peak memory and compiler6;; run time.7 8; CHECK: #dbg_assign(i32 19 10define dso_local void @_Z3funv() local_unnamed_addr !dbg !7 {11entry:12 %sroa-remove-me = alloca i3213 call void @llvm.dbg.assign(metadata i32 undef, metadata !11, metadata !DIExpression(), metadata !13, metadata ptr undef, metadata !DIExpression()), !dbg !1414 call void @_Z3extv(), !dbg !1515 call void @llvm.dbg.assign(metadata i32 0, metadata !11, metadata !DIExpression(), metadata !13, metadata ptr undef, metadata !DIExpression()), !dbg !1416 call void @llvm.dbg.assign(metadata i32 1, metadata !11, metadata !DIExpression(), metadata !13, metadata ptr undef, metadata !DIExpression()), !dbg !1417 ret void, !dbg !1618}19 20declare !dbg !17 dso_local void @_Z3extv() local_unnamed_addr21declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata)22 23!llvm.dbg.cu = !{!0}24!llvm.module.flags = !{!2, !3, !4, !5, !1000}25!llvm.ident = !{!6}26 27!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)28!1 = !DIFile(filename: "test.cpp", directory: "/")29!2 = !{i32 7, !"Dwarf Version", i32 5}30!3 = !{i32 2, !"Debug Info Version", i32 3}31!4 = !{i32 1, !"wchar_size", i32 4}32!5 = !{i32 7, !"uwtable", i32 1}33!6 = !{!"clang version 14.0.0)"}34!7 = distinct !DISubprogram(name: "fun", linkageName: "_Z3funv", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !10)35!8 = !DISubroutineType(types: !9)36!9 = !{null}37!10 = !{!11}38!11 = !DILocalVariable(name: "a", scope: !7, file: !1, line: 2, type: !12)39!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)40!13 = distinct !DIAssignID()41!14 = !DILocation(line: 0, scope: !7)42!15 = !DILocation(line: 2, column: 25, scope: !7)43!16 = !DILocation(line: 2, column: 32, scope: !7)44!17 = !DISubprogram(name: "ext", linkageName: "_Z3extv", scope: !1, file: !1, line: 1, type: !8, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !18)45!18 = !{}46!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}47