Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopDetect / report-scop-location.ll
blobdbd5f5f1e4007a34f4f827aa13ab84a396df69a7
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect -polly-report -disable-output < %s  2>&1 | FileCheck %s
2 target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 ; Function Attrs: nounwind uwtable
6 define void @foo(float* %A) #0 {
7 entry:
8   br label %entry.split
10 entry.split:                                      ; preds = %entry
11   br label %for.body, !dbg !11
13 for.body:                                         ; preds = %entry.split, %for.body
14   %indvar = phi i64 [ 0, %entry.split ], [ %indvar.next, %for.body ]
15   %i.01 = trunc i64 %indvar to i32, !dbg !13
16   %arrayidx = getelementptr float, float* %A, i64 %indvar, !dbg !13
17   %conv = sitofp i32 %i.01 to float, !dbg !13
18   store float %conv, float* %arrayidx, align 4, !dbg !13
19   %indvar.next = add i64 %indvar, 1, !dbg !11
20   %exitcond = icmp ne i64 %indvar.next, 100, !dbg !11
21   br i1 %exitcond, label %for.body, label %for.end, !dbg !11
23 for.end:                                          ; preds = %for.body
24   ret void, !dbg !14
27 ; CHECK: note: Polly detected an optimizable loop region (scop) in function 'foo'
28 ; CHECK: test.c:2: Start of scop
29 ; CHECK: test.c:3: End of scop
31 ; Function Attrs: nounwind uwtable
32 define void @bar(float* %A) #0 {
33 entry:
34   br label %entry.split
36 entry.split:                                      ; preds = %entry
37   br label %for.body, !dbg !15
39 for.body:                                         ; preds = %entry.split, %for.body
40   %indvar = phi i64 [ 0, %entry.split ], [ %indvar.next, %for.body ]
41   %i.01 = trunc i64 %indvar to i32, !dbg !17
42   %arrayidx = getelementptr float, float* %A, i64 %indvar, !dbg !17
43   %conv = sitofp i32 %i.01 to float, !dbg !17
44   store float %conv, float* %arrayidx, align 4, !dbg !17
45   %indvar.next = add i64 %indvar, 1, !dbg !15
46   %exitcond = icmp ne i64 %indvar.next, 100, !dbg !15
47   br i1 %exitcond, label %for.body, label %for.end, !dbg !15
49 for.end:                                          ; preds = %for.body
50   ret void, !dbg !18
53 ; CHECK: note: Polly detected an optimizable loop region (scop) in function 'bar'
54 ; CHECK: test.c:9: Start of scop
55 ; CHECK: test.c:13: End of scop
57 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" }
59 !llvm.dbg.cu = !{!0}
60 !llvm.module.flags = !{!8, !9}
61 !llvm.ident = !{!10}
63 !0 = !{!"0x11\0012\00clang version 3.5 \000\00\000\00\000", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [/home/grosser/Projects/polly/git/tools/polly/test.c] [DW_LANG_C99]
64 !1 = !{!"test.c", !"/home/grosser/Projects/polly/git/tools/polly"}
65 !2 = !{i32 0}
66 !3 = !{!4, !7}
67 !4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\006\00256\000\001", !1, !5, !6, null, void (float*)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
68 !5 = !{!"0x29", !1}          ; [ DW_TAG_file_type ] [/home/grosser/Projects/polly/git/tools/polly/test.c]
69 !6 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !2, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
70 !7 = !{!"0x2e\00bar\00bar\00\006\000\001\000\006\00256\000\006", !1, !5, !6, null, void (float*)* @bar, null, null, !2} ; [ DW_TAG_subprogram ] [line 6] [def] [bar]
71 !8 = !{i32 2, !"Dwarf Version", i32 4}
72 !9 = !{i32 1, !"Debug Info Version", i32 2}
73 !10 = !{!"clang version 3.5 "}
74 !11 = !MDLocation(line: 2, scope: !12)
75 !12 = !{!"0xb\002\000\000", !1, !4} ; [ DW_TAG_lexical_block ] [/home/grosser/Projects/polly/git/tools/polly/test.c]
76 !13 = !MDLocation(line: 3, scope: !12)
77 !14 = !MDLocation(line: 4, scope: !4)
78 !15 = !MDLocation(line: 9, scope: !16)
79 !16 = !{!"0xb\009\000\001", !1, !7} ; [ DW_TAG_lexical_block ] [/home/grosser/Projects/polly/git/tools/polly/test.c]
80 !17 = !MDLocation(line: 13, scope: !16)
81 !18 = !MDLocation(line: 14, scope: !7)