Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopDetectionDiagnostics / ReportVariantBasePtr-01.ll
blobf15eaf5cfc43de3f65d862467cc912140b57d9fd
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 ; struct b {
4 ;   double **b;
5 ; };
7 ; void a(struct b *A) {
8 ;   for (int i=0; i<32; i++)
9 ;     A->b[i] = 0;
10 ; }
12 ; CHECK: remark: ReportVariantBasePtr01.c:6:8: The following errors keep this region from being a Scop.
13 ; CHECK: remark: ReportVariantBasePtr01.c:7:5: The base address of this array is not invariant inside the loop
15 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
16 target triple = "x86_64-unknown-linux-gnu"
18 %struct.b = type { double** }
20 define void @a(%struct.b* nocapture readonly %A) #0 {
21 entry:
22   br label %entry.split
24 entry.split:                                      ; preds = %entry
25   tail call void @llvm.dbg.value(metadata %struct.b* %A, i64 0, metadata !16), !dbg !23
26   tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !17), !dbg !25
27   %b = getelementptr inbounds %struct.b, %struct.b* %A, i64 0, i32 0, !dbg !26
28   br label %for.body, !dbg !27
30 for.body:                                         ; preds = %for.body, %entry.split
31   %indvar4 = phi i64 [ %indvar.next, %for.body ], [ 0, %entry.split ]
32   %0 = mul i64 %indvar4, 4, !dbg !26
33   %1 = add i64 %0, 3, !dbg !26
34   %2 = add i64 %0, 2, !dbg !26
35   %3 = add i64 %0, 1, !dbg !26
36   %4 = load double*** %b, align 8, !dbg !26, !tbaa !28
37   %arrayidx = getelementptr double*, double** %4, i64 %0, !dbg !26
38   store double* null, double** %arrayidx, align 8, !dbg !26, !tbaa !33
39   %5 = load double*** %b, align 8, !dbg !26, !tbaa !28
40   %arrayidx.1 = getelementptr double*, double** %5, i64 %3, !dbg !26
41   store double* null, double** %arrayidx.1, align 8, !dbg !26, !tbaa !33
42   %6 = load double*** %b, align 8, !dbg !26, !tbaa !28
43   %arrayidx.2 = getelementptr double*, double** %6, i64 %2, !dbg !26
44   store double* null, double** %arrayidx.2, align 8, !dbg !26, !tbaa !33
45   %7 = load double*** %b, align 8, !dbg !26, !tbaa !28
46   %arrayidx.3 = getelementptr double*, double** %7, i64 %1, !dbg !26
47   store double* null, double** %arrayidx.3, align 8, !dbg !26, !tbaa !33
48   %indvar.next = add i64 %indvar4, 1, !dbg !27
49   %exitcond = icmp eq i64 %indvar.next, 8, !dbg !27
50   br i1 %exitcond, label %for.end, label %for.body, !dbg !27
52 for.end:                                          ; preds = %for.body
53   ret void, !dbg !34
56 declare void @llvm.dbg.value(metadata, i64, metadata) #1
58 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
59 attributes #1 = { nounwind readnone }
61 !llvm.dbg.cu = !{!0}
62 !llvm.module.flags = !{!20, !21}
63 !llvm.ident = !{!22}
65 !0 = !{!"0x11\0012\00clang version 3.5.0 \001\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [test/ScopDetectionDiagnostics/ReportVariantBasePtr01.c] [DW_LANG_C99]
66 !1 = !{!"ReportVariantBasePtr01.c", !"test/ScopDetectionDiagnostics"}
67 !2 = !{}
68 !3 = !{!4}
69 !4 = !{!"0x2e\00a\00a\00\005\000\001\000\006\00256\001\005", !1, !5, !6, null, void (%struct.b*)* @a, null, null, !15} ; [ DW_TAG_subprogram ] [line 5] [def] [a]
70 !5 = !{!"0x29", !1}          ; [ DW_TAG_file_type ] [test/ScopDetectionDiagnostics/ReportVariantBasePtr01.c]
71 !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 ]
72 !7 = !{null, !8}
73 !8 = !{!"0xf\00\000\0064\0064\000\000", null, null, !9} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from b]
74 !9 = !{!"0x13\00b\001\0064\0064\000\000\000", !1, null, null, !10, null, null, null} ; [ DW_TAG_structure_type ] [b] [line 1, size 64, align 64, offset 0] [def] [from ]
75 !10 = !{!11}
76 !11 = !{!"0xd\00b\002\0064\0064\000\000", !1, !9, !12} ; [ DW_TAG_member ] [b] [line 2, size 64, align 64, offset 0] [from ]
77 !12 = !{!"0xf\00\000\0064\0064\000\000", null, null, !13} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from ]
78 !13 = !{!"0xf\00\000\0064\0064\000\000", null, null, !14} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from double]
79 !14 = !{!"0x24\00double\000\0064\0064\000\000\004", null, null} ; [ DW_TAG_base_type ] [double] [line 0, size 64, align 64, offset 0, enc DW_ATE_float]
80 !15 = !{!16, !17}
81 !16 = !{!"0x101\00A\0016777221\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [A] [line 5]
82 !17 = !{!"0x100\00i\006\000", !18, !5, !19} ; [ DW_TAG_auto_variable ] [i] [line 6]
83 !18 = !{!"0xb\006\003\000", !1, !4} ; [ DW_TAG_lexical_block ] [test/ScopDetectionDiagnostics/ReportVariantBasePtr01.c]
84 !19 = !{!"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]
85 !20 = !{i32 2, !"Dwarf Version", i32 4}
86 !21 = !{i32 2, !"Debug Info Version", i32 2}
87 !22 = !{!"clang version 3.5.0 "}
88 !23 = !MDLocation(line: 5, column: 18, scope: !4)
89 !24 = !{i32 0}
90 !25 = !MDLocation(line: 6, column: 12, scope: !18)
91 !26 = !MDLocation(line: 7, column: 5, scope: !18)
92 !27 = !MDLocation(line: 6, column: 8, scope: !18)
93 !28 = !{!29, !30, i64 0}
94 !29 = !{!"b", !30, i64 0}
95 !30 = !{!"any pointer", !31, i64 0}
96 !31 = !{!"omnipotent char", !32, i64 0}
97 !32 = !{!"Simple C/C++ TBAA"}
98 !33 = !{!30, !30, i64 0}
99 !34 = !MDLocation(line: 8, column: 1, scope: !4)