114 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<detect>' -polly-print-detect -pass-remarks-missed=polly-detect -disable-output < %s 2>&1 | FileCheck %s2target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"3 4;void foo(int a, int b) {5; if(b == 42) {6; if (a > 0) {7; LABEL1:8; a--;9; }10;11; if (a > 0) {12; goto LABEL1;13; }14; b = b + 42;15; }16;}17 18; CHECK: remark: ReportIrreducibleRegion.c:3:7: The following errors keep this region from being a Scop.19; CHECK-NEXT: remark: ReportIrreducibleRegion.c:9:4: Irreducible region encountered in control flow.20; CHECK-NEXT: remark: ReportIrreducibleRegion.c:9:4: Invalid Scop candidate ends here.21 22; Function Attrs: nounwind uwtable23define void @foo(i32 %a, i32 %b) !dbg !4 {24entry:25 %a.addr = alloca i32, align 426 %b.addr = alloca i32, align 427 store i32 %a, ptr %a.addr, align 428 call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !11, metadata !12), !dbg !1329 store i32 %b, ptr %b.addr, align 430 call void @llvm.dbg.declare(metadata ptr %b.addr, metadata !14, metadata !12), !dbg !1531 %0 = load i32, ptr %b.addr, align 4, !dbg !1632 %cmp = icmp eq i32 %0, 42, !dbg !1833 br i1 %cmp, label %if.then, label %if.end6, !dbg !1934 35if.then: ; preds = %entry36 %1 = load i32, ptr %a.addr, align 4, !dbg !2037 %cmp1 = icmp sgt i32 %1, 0, !dbg !2338 br i1 %cmp1, label %if.then2, label %if.end, !dbg !2439 40if.then2: ; preds = %if.then41 br label %LABEL1, !dbg !2542 43LABEL1: ; preds = %if.then4, %if.then244 %2 = load i32, ptr %a.addr, align 4, !dbg !2745 %dec = add nsw i32 %2, -1, !dbg !2746 store i32 %dec, ptr %a.addr, align 4, !dbg !2747 br label %if.end, !dbg !2948 49if.end: ; preds = %LABEL1, %if.then50 %3 = load i32, ptr %a.addr, align 4, !dbg !3051 %cmp3 = icmp sgt i32 %3, 0, !dbg !3252 br i1 %cmp3, label %if.then4, label %if.end5, !dbg !3353 54if.then4: ; preds = %if.end55 br label %LABEL1, !dbg !3456 57if.end5: ; preds = %if.end58 %4 = load i32, ptr %b.addr, align 4, !dbg !3659 %add = add nsw i32 %4, 42, !dbg !3760 store i32 %add, ptr %b.addr, align 4, !dbg !3861 br label %if.end6, !dbg !3962 63if.end6: ; preds = %if.end5, %entry64 ret void, !dbg !4065}66 67; Function Attrs: nounwind readnone68declare void @llvm.dbg.declare(metadata, metadata, metadata)69 70!llvm.dbg.cu = !{!0}71!llvm.module.flags = !{!8, !9}72!llvm.ident = !{!10}73 74!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2)75!1 = !DIFile(filename: "ReportIrreducibleRegion.c", directory: "llvm/tools/polly/test/ScopDetectionDiagnostics")76!2 = !{}77!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)78!5 = !DISubroutineType(types: !6)79!6 = !{null, !7, !7}80!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)81!8 = !{i32 2, !"Dwarf Version", i32 4}82!9 = !{i32 2, !"Debug Info Version", i32 3}83!10 = !{!"clang version 3.8.0"}84!11 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 1, type: !7)85!12 = !DIExpression()86!13 = !DILocation(line: 1, column: 14, scope: !4)87!14 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 1, type: !7)88!15 = !DILocation(line: 1, column: 21, scope: !4)89!16 = !DILocation(line: 2, column: 5, scope: !17)90!17 = distinct !DILexicalBlock(scope: !4, file: !1, line: 2, column: 5)91!18 = !DILocation(line: 2, column: 7, scope: !17)92!19 = !DILocation(line: 2, column: 5, scope: !4)93!20 = !DILocation(line: 3, column: 7, scope: !21)94!21 = distinct !DILexicalBlock(scope: !22, file: !1, line: 3, column: 7)95!22 = distinct !DILexicalBlock(scope: !17, file: !1, line: 2, column: 14)96!23 = !DILocation(line: 3, column: 9, scope: !21)97!24 = !DILocation(line: 3, column: 7, scope: !22)98!25 = !DILocation(line: 3, column: 14, scope: !26)99!26 = !DILexicalBlockFile(scope: !21, file: !1, discriminator: 1)100!27 = !DILocation(line: 5, column: 5, scope: !28)101!28 = distinct !DILexicalBlock(scope: !21, file: !1, line: 3, column: 14)102!29 = !DILocation(line: 6, column: 3, scope: !28)103!30 = !DILocation(line: 8, column: 7, scope: !31)104!31 = distinct !DILexicalBlock(scope: !22, file: !1, line: 8, column: 7)105!32 = !DILocation(line: 8, column: 9, scope: !31)106!33 = !DILocation(line: 8, column: 7, scope: !22)107!34 = !DILocation(line: 9, column: 4, scope: !35)108!35 = distinct !DILexicalBlock(scope: !31, file: !1, line: 8, column: 14)109!36 = !DILocation(line: 11, column: 7, scope: !22)110!37 = !DILocation(line: 11, column: 9, scope: !22)111!38 = !DILocation(line: 11, column: 5, scope: !22)112!39 = !DILocation(line: 12, column: 2, scope: !22)113!40 = !DILocation(line: 13, column: 1, scope: !4)114