xref: /llvm-project/polly/test/Support/pollyDebug.ll (revision 15397583e3d85eb1f1a051de26eb409aaedd3b54)
1; Test if "polly-debug" flag enables debug prints from different parts of polly
2; RUN: opt %loadNPMPolly -O3 -polly -polly-debug --disable-output < %s 2>&1 | FileCheck %s
3;
4; REQUIRES: asserts
5
6; void callee(int n, double A[], int i) {
7;   for (int j = 0; j < n; j += 1)
8;     A[i+j] = 42.0;
9; }
10;
11; void caller(int n, double A[]) {
12;   for (int i = 0; i < n; i += 1)
13;     callee(n, A, i);
14; }
15
16
17%unrelated_type = type { i32 }
18
19define internal void @callee(i32 %n, ptr noalias nonnull %A, i32 %i) #0 {
20entry:
21  br label %for
22
23for:
24  %j = phi i32 [0, %entry], [%j.inc, %inc]
25  %j.cmp = icmp slt i32 %j, %n
26  br i1 %j.cmp, label %body, label %exit
27
28    body:
29      %idx = add i32 %i, %j
30      %arrayidx = getelementptr inbounds double, ptr %A, i32 %idx
31      store double 42.0, ptr %arrayidx
32      br label %inc
33
34inc:
35  %j.inc = add nuw nsw i32 %j, 1
36  br label %for
37
38exit:
39  br label %return
40
41return:
42  ret void
43}
44
45
46define void @caller(i32 %n, ptr noalias nonnull %A) #0 {
47entry:
48  br label %for
49
50for:
51  %i = phi i32 [0, %entry], [%j.inc, %inc]
52  %i.cmp = icmp slt i32 %i, %n
53  br i1 %i.cmp, label %body, label %exit
54
55    body:
56      call void @callee(i32 %n, ptr %A, i32 %i)
57      br label %inc
58
59inc:
60  %j.inc = add nuw nsw i32 %i, 1
61  br label %for
62
63exit:
64  br label %return
65
66return:
67  ret void
68}
69
70
71declare void @unrelated_decl()
72
73
74attributes #0 = { noinline }
75
76!llvm.ident = !{!8}
77!8 = !{!"xyxxy"}
78
79; CHECK: Checking region: entry => <Function Return>
80; CHECK: Removing statements that are never executed...
81; CHECK: Final Scop:
82; CHECK: Forwarding operand trees...
83; CHECK: Final Scop:
84; CHECK: Collapsing scalars to unused array elements...
85; CHECK: Final Scop:
86