1 ; RUN: opt %loadPolly -polly-analysis-computeout=0 -polly-print-scops -polly-rtc-max-parameters=8 -disable-output < %s | FileCheck %s --check-prefix=MAX8
2 ; RUN: opt %loadPolly -polly-analysis-computeout=0 -polly-print-scops -polly-rtc-max-parameters=7 -disable-output < %s | FileCheck %s --check-prefix=MAX7
4 ; Check that we allow this SCoP even though it has 10 parameters involved in possibly aliasing accesses.
5 ; However, only 7 are involved in accesses through B, 8 through C and none in accesses through A.
7 ; MAX8-LABEL: Function: jd
8 ; MAX8-NEXT: Region: %for.cond---%for.end
12 ; void jd(int *A, int *B, int *C, long p1, long p2, long p3, long p4, long p5,
13 ; long p6, long p7, long p8, long p9, long p10) {
14 ; for (int i = 0; i < 1024; i++)
15 ; A[i] = B[p1] - B[p2] + B[-p3] - B[p4] + B[p5] - B[-p6] + B[p7] - C[p3] +
16 ; C[-p4] - C[p5] + C[p6] - C[-p7] + C[p8] - C[p9] + C[-p10];
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 define void @jd(ptr %A, ptr %B, ptr %C, i64 %p1, i64 %p2, i64 %p3, i64 %p4, i64 %p5, i64 %p6, i64 %p7, i64 %p8, i64 %p9, i64 %p10) {
25 for.cond: ; preds = %for.inc, %entry
26 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
27 %exitcond = icmp ne i64 %indvars.iv, 1024
28 br i1 %exitcond, label %for.body, label %for.end
30 for.body: ; preds = %for.cond
31 %arrayidx = getelementptr inbounds i32, ptr %B, i64 %p1
32 %tmp = load i32, ptr %arrayidx, align 4
33 %arrayidx1 = getelementptr inbounds i32, ptr %B, i64 %p2
34 %tmp1 = load i32, ptr %arrayidx1, align 4
35 %sub = sub nsw i32 %tmp, %tmp1
36 %sub2 = sub nsw i64 0, %p3
37 %arrayidx3 = getelementptr inbounds i32, ptr %B, i64 %sub2
38 %tmp2 = load i32, ptr %arrayidx3, align 4
39 %add = add nsw i32 %sub, %tmp2
40 %arrayidx4 = getelementptr inbounds i32, ptr %B, i64 %p4
41 %tmp3 = load i32, ptr %arrayidx4, align 4
42 %sub5 = sub nsw i32 %add, %tmp3
43 %arrayidx6 = getelementptr inbounds i32, ptr %B, i64 %p5
44 %tmp4 = load i32, ptr %arrayidx6, align 4
45 %add7 = add nsw i32 %sub5, %tmp4
46 %sub8 = sub nsw i64 0, %p6
47 %arrayidx9 = getelementptr inbounds i32, ptr %B, i64 %sub8
48 %tmp5 = load i32, ptr %arrayidx9, align 4
49 %sub10 = sub nsw i32 %add7, %tmp5
50 %arrayidx11 = getelementptr inbounds i32, ptr %B, i64 %p7
51 %tmp6 = load i32, ptr %arrayidx11, align 4
52 %add12 = add nsw i32 %sub10, %tmp6
53 %arrayidx13 = getelementptr inbounds i32, ptr %C, i64 %p3
54 %tmp7 = load i32, ptr %arrayidx13, align 4
55 %sub14 = sub nsw i32 %add12, %tmp7
56 %sub15 = sub nsw i64 0, %p4
57 %arrayidx16 = getelementptr inbounds i32, ptr %C, i64 %sub15
58 %tmp8 = load i32, ptr %arrayidx16, align 4
59 %add17 = add nsw i32 %sub14, %tmp8
60 %arrayidx18 = getelementptr inbounds i32, ptr %C, i64 %p5
61 %tmp9 = load i32, ptr %arrayidx18, align 4
62 %sub19 = sub nsw i32 %add17, %tmp9
63 %arrayidx20 = getelementptr inbounds i32, ptr %C, i64 %p6
64 %tmp10 = load i32, ptr %arrayidx20, align 4
65 %add21 = add nsw i32 %sub19, %tmp10
66 %sub22 = sub nsw i64 0, %p7
67 %arrayidx23 = getelementptr inbounds i32, ptr %C, i64 %sub22
68 %tmp11 = load i32, ptr %arrayidx23, align 4
69 %sub24 = sub nsw i32 %add21, %tmp11
70 %arrayidx25 = getelementptr inbounds i32, ptr %C, i64 %p8
71 %tmp12 = load i32, ptr %arrayidx25, align 4
72 %add26 = add nsw i32 %sub24, %tmp12
73 %arrayidx27 = getelementptr inbounds i32, ptr %C, i64 %p9
74 %tmp13 = load i32, ptr %arrayidx27, align 4
75 %sub28 = sub nsw i32 %add26, %tmp13
76 %sub29 = sub nsw i64 0, %p10
77 %arrayidx30 = getelementptr inbounds i32, ptr %C, i64 %sub29
78 %tmp14 = load i32, ptr %arrayidx30, align 4
79 %add31 = add nsw i32 %sub28, %tmp14
80 %arrayidx32 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
81 store i32 %add31, ptr %arrayidx32, align 4
84 for.inc: ; preds = %for.body
85 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
88 for.end: ; preds = %for.cond