1 ; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s
3 ; Verify that the outer dimension doesnt't carry reduction dependences
5 ; CHECK-NOT:#pragma known-parallel reduction
6 ; CHECK: #pragma known-parallel
7 ; CHECK: for (int c1 = 0; c1 < 2 * n; c1 += 1)
8 ; CHECK: #pragma simd reduction
9 ; CHECK: for (int c3 = -1023; c3 <= 1023; c3 += 1) {
10 ; CHECK: if (c3 >= 1 && (c3 + 1) % 2 == 0) {
11 ; CHECK: Stmt_for_body3(c1, c3);
12 ; CHECK: } else if (c3 <= 0 && c3 % 2 == 0) {
13 ; CHECK: Stmt_for_body3(c1, -c3);
17 ; void rmsmd4(int *A, long n) {
18 ; for (long i = 0; i < 2 * n; i++)
19 ; for (long j = 0; j < 1024; j++)
23 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
25 define void @rmsmd4(i32* %A, i32 %n) {
29 for.cond: ; preds = %for.inc4, %entry
30 %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ]
31 %mul = shl nsw i32 %n, 1
32 %cmp = icmp slt i32 %i.0, %mul
33 br i1 %cmp, label %for.body, label %for.end6
35 for.body: ; preds = %for.cond
38 for.cond1: ; preds = %for.inc, %for.body
39 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
40 %exitcond = icmp ne i32 %j.0, 1024
41 br i1 %exitcond, label %for.body3, label %for.end
43 for.body3: ; preds = %for.cond1
44 %arrayidx = getelementptr inbounds i32, i32* %A, i32 %i.0
45 %tmp = load i32, i32* %arrayidx, align 4
46 %add = add nsw i32 %tmp, %i.0
47 store i32 %add, i32* %arrayidx, align 4
50 for.inc: ; preds = %for.body3
51 %inc = add nsw i32 %j.0, 1
54 for.end: ; preds = %for.cond1
57 for.inc4: ; preds = %for.end
58 %inc5 = add nsw i32 %i.0, 1
61 for.end6: ; preds = %for.cond