64 lines · plain
1; RUN: opt -passes=lcssa -S %s | FileCheck %s2source_filename = "small.c"3 4@a = common dso_local global i32 0, align 4, !dbg !05 6; CHECK-LABEL: @f7define dso_local void @f() !dbg !10 {8entry:9 %0 = load i32, ptr @a, align 4, !dbg !1710 %tobool1 = icmp eq i32 %0, 0, !dbg !1811 br i1 %tobool1, label %for.end, label %for.inc.lr.ph, !dbg !1812 13for.inc.lr.ph: ; preds = %entry14 br label %for.inc, !dbg !1815 16for.inc: ; preds = %for.inc, %for.inc.lr.ph17 %1 = phi i32 [ %0, %for.inc.lr.ph ], [ %inc, %for.inc ]18 call void @llvm.dbg.label(metadata !14), !dbg !1919 %inc = add nsw i32 %1, 1, !dbg !2020 %tobool = icmp eq i32 %inc, 0, !dbg !1821 br i1 %tobool, label %for.cond.for.end_crit_edge, label %for.inc, !dbg !18, !llvm.loop !2122 23for.cond.for.end_crit_edge: ; preds = %for.inc24 store i32 %inc, ptr @a, align 4, !dbg !1725 br label %for.end, !dbg !1826 27for.end: ; preds = %entry, %for.cond.for.end_crit_edge28 ret void, !dbg !2329}30 31; Function Attrs: nounwind readnone speculatable32declare void @llvm.dbg.label(metadata) #033 34attributes #0 = { nounwind readnone speculatable }35 36!llvm.dbg.cu = !{!2}37!llvm.module.flags = !{!7, !8, !9}38 39!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())40!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)41!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)42!3 = !DIFile(filename: "small.c", directory: "./")43!4 = !{}44!5 = !{!0}45!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)46!7 = !{i32 2, !"Dwarf Version", i32 4}47!8 = !{i32 2, !"Debug Info Version", i32 3}48!9 = !{i32 1, !"wchar_size", i32 4}49!10 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 3, type: !11, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: true, unit: !2, retainedNodes: !13)50!11 = !DISubroutineType(types: !12)51!12 = !{null}52!13 = !{!14}53!14 = !DILabel(scope: !15, name: "L", file: !3, line: 6)54!15 = distinct !DILexicalBlock(scope: !16, file: !3, line: 5, column: 3)55!16 = distinct !DILexicalBlock(scope: !10, file: !3, line: 5, column: 3)56!17 = !DILocation(line: 5, column: 10, scope: !15)57!18 = !DILocation(line: 5, column: 3, scope: !16)58!19 = !DILocation(line: 6, column: 3, scope: !15)59!20 = !DILocation(line: 5, column: 14, scope: !15)60!21 = distinct !{!21, !18, !22}61!22 = !DILocation(line: 6, column: 5, scope: !16)62!23 = !DILocation(line: 7, column: 1, scope: !10)63 64