236
|
1 ; New pass manager
|
252
|
2 ; RUN: opt %loadNPMPolly -O3 -polly -polly-position=before-vectorizer -polly-dump-before --disable-output %s
|
236
|
3 ; RUN: FileCheck --input-file=dumpfunction-callee-before.ll --check-prefix=CHECK --check-prefix=CALLEE %s
|
|
4 ; RUN: FileCheck --input-file=dumpfunction-caller-before.ll --check-prefix=CHECK --check-prefix=CALLER %s
|
|
5 ;
|
252
|
6 ; RUN: opt %loadNPMPolly -O3 -polly -polly-position=before-vectorizer -polly-dump-after --disable-output %s
|
236
|
7 ; RUN: FileCheck --input-file=dumpfunction-callee-after.ll --check-prefix=CHECK --check-prefix=CALLEE %s
|
|
8 ; RUN: FileCheck --input-file=dumpfunction-caller-after.ll --check-prefix=CHECK --check-prefix=CALLER %s
|
|
9
|
|
10 ; void callee(int n, double A[], int i) {
|
|
11 ; for (int j = 0; j < n; j += 1)
|
|
12 ; A[i+j] = 42.0;
|
|
13 ; }
|
|
14 ;
|
|
15 ; void caller(int n, double A[]) {
|
|
16 ; for (int i = 0; i < n; i += 1)
|
|
17 ; callee(n, A, i);
|
|
18 ; }
|
|
19
|
|
20
|
|
21 %unrelated_type = type { i32 }
|
|
22
|
252
|
23 define internal void @callee(i32 %n, ptr noalias nonnull %A, i32 %i) #0 {
|
236
|
24 entry:
|
|
25 br label %for
|
|
26
|
|
27 for:
|
|
28 %j = phi i32 [0, %entry], [%j.inc, %inc]
|
|
29 %j.cmp = icmp slt i32 %j, %n
|
|
30 br i1 %j.cmp, label %body, label %exit
|
|
31
|
|
32 body:
|
|
33 %idx = add i32 %i, %j
|
252
|
34 %arrayidx = getelementptr inbounds double, ptr %A, i32 %idx
|
|
35 store double 42.0, ptr %arrayidx
|
236
|
36 br label %inc
|
|
37
|
|
38 inc:
|
|
39 %j.inc = add nuw nsw i32 %j, 1
|
|
40 br label %for
|
|
41
|
|
42 exit:
|
|
43 br label %return
|
|
44
|
|
45 return:
|
|
46 ret void
|
|
47 }
|
|
48
|
|
49
|
252
|
50 define void @caller(i32 %n, ptr noalias nonnull %A) #0 {
|
236
|
51 entry:
|
|
52 br label %for
|
|
53
|
|
54 for:
|
|
55 %i = phi i32 [0, %entry], [%j.inc, %inc]
|
|
56 %i.cmp = icmp slt i32 %i, %n
|
|
57 br i1 %i.cmp, label %body, label %exit
|
|
58
|
|
59 body:
|
252
|
60 call void @callee(i32 %n, ptr %A, i32 %i)
|
236
|
61 br label %inc
|
|
62
|
|
63 inc:
|
|
64 %j.inc = add nuw nsw i32 %i, 1
|
|
65 br label %for
|
|
66
|
|
67 exit:
|
|
68 br label %return
|
|
69
|
|
70 return:
|
|
71 ret void
|
|
72 }
|
|
73
|
|
74
|
|
75 declare void @unrelated_decl()
|
|
76
|
|
77
|
|
78 attributes #0 = { noinline }
|
|
79
|
|
80 !llvm.ident = !{!8}
|
|
81 !8 = !{!"xyxxy"}
|
|
82
|
|
83
|
|
84 ; CHECK-NOT: unrelated_type
|
|
85
|
|
86 ; CALLEE-LABEL: @callee(
|
|
87 ; CALLEE-NOT: @caller
|
|
88 ; CALLEE-NOT: @unrelated_decl
|
|
89
|
|
90 ; CALLER-NOT: define {{.*}} @callee(
|
|
91 ; CALLER-LABEL: @caller(
|
|
92
|
|
93 ; CHECK-NOT: @unrelated_decl
|
|
94 ; CHECK: xyxxy
|