1 ; RUN: opt %loadPolly -polly-print-ast -polly-ast-detect-parallel -disable-output < %s | FileCheck %s
3 ; CHECK: #pragma known-parallel reduction (^ : MemRef_sum)
4 ; void f(int N, int M, int *sum) {
5 ; for (int i = 0; i < N; i++)
7 ; for (int j = 0; j < M; j++)
11 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
13 define void @f(i32 %N, i32 %M, ptr %sum) {
17 for.cond: ; preds = %for.inc4, %entry
18 %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ]
19 %cmp = icmp slt i32 %i.0, %N
20 br i1 %cmp, label %for.body, label %for.end6
22 for.body: ; preds = %for.cond
25 for.cond1: ; preds = %for.inc, %for.body
26 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
27 %cmp2 = icmp slt i32 %j.0, %M
28 br i1 %cmp2, label %for.body3, label %for.end
30 for.body3: ; preds = %for.cond1
31 %arrayidx = getelementptr inbounds i32, ptr %sum, i32 %j.0
32 %tmp = load i32, ptr %arrayidx, align 4
33 %xor = xor i32 %tmp, %j.0
34 store i32 %xor, ptr %arrayidx, align 4
37 for.inc: ; preds = %for.body3
38 %inc = add nsw i32 %j.0, 1
41 for.end: ; preds = %for.cond1
44 for.inc4: ; preds = %for.end
45 %inc5 = add nsw i32 %i.0, 1
48 for.end6: ; preds = %for.cond