brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 11b3eb0 Raw
45 lines · plain
1; The loop canonicalization pass should guarantee that there is one backedge2; for all loops.  This allows the -passes=indvars pass to recognize the %IV3; induction variable in this testcase.4 5; RUN: opt < %s -passes=indvars -S | FileCheck %s6; CHECK: Loop.backedge:7; CHECK-NOT: br8; CHECK: br label %Loop, !dbg [[BACKEDGE_LOC:![0-9]+]]9 10; CHECK: [[BACKEDGE_LOC]] = !DILocation(line: 101, column: 1, scope: !{{.*}})11 12define i32 @test(i1 %C) {13; <label>:014  br label %Loop, !dbg !615Loop: ; preds = %BE2, %BE1, %016  %IV = phi i32 [ 1, %0 ], [ %IV2, %BE1 ], [ %IV2, %BE2 ] ; <i32> [#uses=2]17  store i32 %IV, ptr null, !dbg !718  %IV2 = add i32 %IV, 2, !dbg !8 ; <i32> [#uses=2]19  br i1 %C, label %BE1, label %BE2, !dbg !920BE1:  ; preds = %Loop21  br label %Loop, !dbg !1022BE2:    ; preds = %n br label %Loop23  br label %Loop, !dbg !1124}25 26!llvm.module.flags = !{!0, !1}27!llvm.dbg.cu = !{!12}28!0 = !{i32 2, !"Dwarf Version", i32 4}29!1 = !{i32 2, !"Debug Info Version", i32 3}30 31!2 = !{}32!3 = !DISubroutineType(types: !2)33!4 = !DIFile(filename: "atomic.cpp", directory: "/tmp")34!5 = distinct !DISubprogram(name: "test", scope: !4, file: !4, line: 99, type: !3, isLocal: false, isDefinition: true, scopeLine: 100, flags: DIFlagPrototyped, isOptimized: false, unit: !12, retainedNodes: !2)35!6 = !DILocation(line: 100, column: 1, scope: !5)36!7 = !DILocation(line: 101, column: 1, scope: !5)37!8 = !DILocation(line: 102, column: 1, scope: !5)38!9 = !DILocation(line: 103, column: 1, scope: !5)39!10 = !DILocation(line: 104, column: 1, scope: !5)40!11 = !DILocation(line: 105, column: 1, scope: !5)41!12 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",42                             file: !4,43                             isOptimized: true, flags: "-O2",44                             splitDebugFilename: "abc.debug", emissionKind: 2)45