Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopDetectionDiagnostics / ReportLoopBound-01.ll
blob81ee240f75efad7ea4f93a57f4e0215f44e6656e
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -pass-remarks-missed="polly-detect" -polly-detect-track-failures -polly-detect -analyze < %s 2>&1| FileCheck %s
3 ; void f(int A[], int n) {
4 ;   for (int i = 0; i < A[n]; i++)
5 ;     A[i] = 0;
6 ; }
8 ; CHECK: remark: ReportLoopBound-01.c:2:8: The following errors keep this region from being a Scop.
9 ; CHECK: remark: ReportLoopBound-01.c:2:8: Failed to derive an affine function from the loop bounds.
10 ; CHECK: remark: ReportLoopBound-01.c:3:5: Invalid Scop candidate ends here.
12 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13 target triple = "x86_64-unknown-linux-gnu"
15 define void @f(i32* %A, i32 %n) {
16 entry:
17   br label %entry.split
19 entry.split:                                      ; preds = %entry
20   tail call void @llvm.dbg.value(metadata i32* %A, i64 0, metadata !13), !dbg !14
21   tail call void @llvm.dbg.value(metadata i32 %n, i64 0, metadata !15), !dbg !16
22   tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !18), !dbg !20
23   %idxprom = sext i32 %n to i64, !dbg !21
24   %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom, !dbg !21
25   %0 = load i32* %arrayidx, align 4, !dbg !21
26   %cmp3 = icmp sgt i32 %0, 0, !dbg !21
27   br i1 %cmp3, label %for.body.lr.ph, label %for.end, !dbg !21
29 for.body.lr.ph:                                   ; preds = %entry.split
30   br label %for.body, !dbg !22
32 for.body:                                         ; preds = %for.body.lr.ph, %for.body
33   %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.body ]
34   %arrayidx2 = getelementptr i32, i32* %A, i64 %indvar, !dbg !24
35   %1 = add i64 %indvar, 1, !dbg !24
36   %inc = trunc i64 %1 to i32, !dbg !21
37   store i32 0, i32* %arrayidx2, align 4, !dbg !24
38   tail call void @llvm.dbg.value(metadata !{null}, i64 0, metadata !18), !dbg !20
39   %2 = load i32* %arrayidx, align 4, !dbg !21
40   %cmp = icmp slt i32 %inc, %2, !dbg !21
41   %indvar.next = add i64 %indvar, 1, !dbg !21
42   br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge, !dbg !21
44 for.cond.for.end_crit_edge:                       ; preds = %for.body
45   br label %for.end, !dbg !25
47 for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry.split
48   ret void, !dbg !27
51 declare void @llvm.dbg.declare(metadata, metadata)
53 declare void @llvm.dbg.value(metadata, i64, metadata)
55 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
56 attributes #1 = { nounwind readnone }
58 !llvm.dbg.cu = !{!0}
59 !llvm.module.flags = !{!10, !11}
60 !llvm.ident = !{!12}
62 !0 = !{!"0x11\0012\00clang version 3.6.0 \000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [test/ScopDetectionDiagnostic/ReportLoopBound-01.c] [DW_LANG_C99]
63 !1 = !{!"ReportLoopBound-01.c", !"test/ScopDetectionDiagnostic/"}
64 !2 = !{}
65 !3 = !{!4}
66 !4 = !{!"0x2e\00f\00f\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i32*, i32)* @f, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [f]
67 !5 = !{!"0x29", !1}          ; [ DW_TAG_file_type ] [test/ScopDetectionDiagnostic/ReportLoopBound-01.c]
68 !6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
69 !7 = !{null, !8, !9}
70 !8 = !{!"0xf\00\000\0064\0064\000\000", null, null, !9} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from int]
71 !9 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
72 !10 = !{i32 2, !"Dwarf Version", i32 4}
73 !11 = !{i32 2, !"Debug Info Version", i32 2}
74 !12 = !{!"clang version 3.6.0 "}
75 !13 = !{!"0x101\00A\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [A] [line 1]
76 !14 = !MDLocation(line: 1, column: 12, scope: !4)
77 !15 = !{!"0x101\00n\0033554433\000", !4, !5, !9} ; [ DW_TAG_arg_variable ] [n] [line 1]
78 !16 = !MDLocation(line: 1, column: 21, scope: !4)
79 !17 = !{i32 0}
80 !18 = !{!"0x100\00i\002\000", !19, !5, !9} ; [ DW_TAG_auto_variable ] [i] [line 2]
81 !19 = !{!"0xb\002\003\000", !1, !4} ; [ DW_TAG_lexical_block ] [test/ScopDetectionDiagnostic/ReportLoopBound-01.c]
82 !20 = !MDLocation(line: 2, column: 12, scope: !19)
83 !21 = !MDLocation(line: 2, column: 8, scope: !19)
84 !22 = !MDLocation(line: 2, column: 8, scope: !23)
85 !23 = !{!"0xb\002\008\001", !1, !19} ; [ DW_TAG_lexical_block ] [test/ScopDetectionDiagnostic/ReportLoopBound-01.c]
86 !24 = !MDLocation(line: 3, column: 5, scope: !19)
87 !25 = !MDLocation(line: 2, column: 8, scope: !26)
88 !26 = !{!"0xb\002\008\002", !1, !19} ; [ DW_TAG_lexical_block ] [test/ScopDetectionDiagnostic/ReportLoopBound-01.c]
89 !27 = !MDLocation(line: 4, column: 1, scope: !4)