236
|
1 ; RUN: opt %loadNPMPolly -O3 -polly -polly-position=early -polly-dump-before-file=%t-npm-before-early.ll --disable-output < %s && FileCheck --input-file=%t-npm-before-early.ll --check-prefix=EARLY %s
|
|
2 ; RUN: opt %loadNPMPolly -O3 -polly -polly-position=early -polly-dump-after-file=%t-npm-after-early.ll --disable-output < %s && FileCheck --input-file=%t-npm-after-early.ll --check-prefix=EARLY --check-prefix=AFTEREARLY %s
|
221
|
3 ;
|
|
4 ; Check the module dumping before Polly at specific positions in the
|
|
5 ; pass pipeline.
|
|
6 ;
|
|
7 ; void callee(int n, double A[], int i) {
|
|
8 ; for (int j = 0; j < n; j += 1)
|
|
9 ; A[i+j] = 42.0;
|
|
10 ; }
|
|
11 ;
|
|
12 ; void caller(int n, double A[]) {
|
|
13 ; for (int i = 0; i < n; i += 1)
|
|
14 ; callee(n, A, i);
|
|
15 ; }
|
|
16
|
|
17
|
252
|
18 define internal void @callee(i32 %n, ptr noalias nonnull %A, i32 %i) {
|
221
|
19 entry:
|
|
20 br label %for
|
|
21
|
|
22 for:
|
|
23 %j = phi i32 [0, %entry], [%j.inc, %inc]
|
|
24 %j.cmp = icmp slt i32 %j, %n
|
|
25 br i1 %j.cmp, label %body, label %exit
|
|
26
|
|
27 body:
|
|
28 %idx = add i32 %i, %j
|
252
|
29 %arrayidx = getelementptr inbounds double, ptr %A, i32 %idx
|
|
30 store double 42.0, ptr %arrayidx
|
221
|
31 br label %inc
|
|
32
|
|
33 inc:
|
|
34 %j.inc = add nuw nsw i32 %j, 1
|
|
35 br label %for
|
|
36
|
|
37 exit:
|
|
38 br label %return
|
|
39
|
|
40 return:
|
|
41 ret void
|
|
42 }
|
|
43
|
|
44
|
252
|
45 define void @caller(i32 %n, ptr noalias nonnull %A) {
|
221
|
46 entry:
|
|
47 br label %for
|
|
48
|
|
49 for:
|
|
50 %i = phi i32 [0, %entry], [%j.inc, %inc]
|
|
51 %i.cmp = icmp slt i32 %i, %n
|
|
52 br i1 %i.cmp, label %body, label %exit
|
|
53
|
|
54 body:
|
252
|
55 call void @callee(i32 %n, ptr %A, i32 %i)
|
221
|
56 br label %inc
|
|
57
|
|
58 inc:
|
|
59 %j.inc = add nuw nsw i32 %i, 1
|
|
60 br label %for
|
|
61
|
|
62 exit:
|
|
63 br label %return
|
|
64
|
|
65 return:
|
|
66 ret void
|
|
67 }
|
|
68
|
|
69
|
|
70 ; EARLY-LABEL: @callee(
|
|
71 ; AFTEREARLY: polly.split_new_and_old:
|
252
|
72 ; EARLY: store double 4.200000e+01, ptr %arrayidx
|
221
|
73 ; EARLY-LABEL: @caller(
|
|
74 ; EARLY: call void @callee(
|
|
75
|
|
76 ; LATE-LABEL: @caller(
|
|
77 ; AFTERLATE: polly.split_new_and_old:
|
252
|
78 ; LATE: store double 4.200000e+01, ptr %arrayidx
|