Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopDetectionDiagnostics / ReportNonAffineAccess-01.ll
blob73bafa63f34e30523b006aae0da62a283a8567c3
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[]) {
4 ;   for(int i=0; i<42; ++i)
5 ;     A[i*i] = 0;
6 ; }
9 ; CHECK: remark: ReportNonAffineAccess-01.c:2:7: The following errors keep this region from being a Scop.
10 ; CHECK: remark: ReportNonAffineAccess-01.c:3:5: The array subscript of "A" is not affine
11 ; CHECK: remark: ReportNonAffineAccess-01.c:3:5: Invalid Scop candidate ends here.
13 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
14 target triple = "x86_64-unknown-linux-gnu"
16 define void @f(i32* %A) {
17 entry:
18   br label %entry.split
20 entry.split:                                      ; preds = %entry
21   tail call void @llvm.dbg.value(metadata i32* %A, i64 0, metadata !13), !dbg !14
22   tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16), !dbg !18
23   br label %for.body, !dbg !19
25 for.body:                                         ; preds = %entry.split, %for.body
26   %0 = phi i32 [ 0, %entry.split ], [ %1, %for.body ], !dbg !20
27   %mul = mul nsw i32 %0, %0, !dbg !20
28   %idxprom1 = zext i32 %mul to i64, !dbg !20
29   %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom1, !dbg !20
30   store i32 0, i32* %arrayidx, align 4, !dbg !20
31   %1 = add nsw i32 %0, 1, !dbg !21
32   tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !16), !dbg !18
33   %exitcond = icmp ne i32 %1, 42, !dbg !19
34   br i1 %exitcond, label %for.body, label %for.end, !dbg !19
36 for.end:                                          ; preds = %for.body
37   ret void, !dbg !22
40 declare void @llvm.dbg.declare(metadata, metadata)
42 declare void @llvm.dbg.value(metadata, i64, metadata)
44 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" }
45 attributes #1 = { nounwind readnone }
47 !llvm.dbg.cu = !{!0}
48 !llvm.module.flags = !{!10, !11}
49 !llvm.ident = !{!12}
51 !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/ReportNonAffineAccess-01.c] [DW_LANG_C99]
52 !1 = !{!"ReportNonAffineAccess-01.c", !"test/ScopDetectionDiagnostic/"}
53 !2 = !{}
54 !3 = !{!4}
55 !4 = !{!"0x2e\00f\00f\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (i32*)* @f, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [f]
56 !5 = !{!"0x29", !1}          ; [ DW_TAG_file_type ] [test/ScopDetectionDiagnostic/ReportNonAffineAccess-01.c]
57 !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 ]
58 !7 = !{null, !8}
59 !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]
60 !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]
61 !10 = !{i32 2, !"Dwarf Version", i32 4}
62 !11 = !{i32 2, !"Debug Info Version", i32 2}
63 !12 = !{!"clang version 3.6.0 "}
64 !13 = !{!"0x101\00A\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [A] [line 1]
65 !14 = !MDLocation(line: 1, column: 12, scope: !4)
66 !15 = !{i32 0}
67 !16 = !{!"0x100\00i\002\000", !17, !5, !9} ; [ DW_TAG_auto_variable ] [i] [line 2]
68 !17 = !{!"0xb\002\003\000", !1, !4} ; [ DW_TAG_lexical_block ] [test/ScopDetectionDiagnostic/ReportNonAffineAccess-01.c]
69 !18 = !MDLocation(line: 2, column: 11, scope: !17)
70 !19 = !MDLocation(line: 2, column: 7, scope: !17)
71 !20 = !MDLocation(line: 3, column: 5, scope: !17)
72 !21 = !MDLocation(line: 2, column: 22, scope: !17)
73 !22 = !MDLocation(line: 4, column: 1, scope: !4)