1; RUN: opt %loadNPMPolly '-passes=polly-import-jscop,print<polly-ast>' -polly-ast-detect-parallel -disable-output < %s | FileCheck %s 2; 3; CHECK: #pragma known-parallel 4; CHECK: for (int c0 = 0; c0 <= 1; c0 += 1) 5; CHECK: for (int c1 = c0; c1 < 2 * n; c1 += 2) 6; CHECK: #pragma simd reduction 7; CHECK: for (int c3 = 0; c3 <= 1023; c3 += 1) 8; CHECK: Stmt_for_body3(c1, c3); 9; 10; void rmsmd(int *A, long n) { 11; for (long i = 0; i < 2 * n; i++) 12; for (long j = 0; j < 1024; j++) 13; A[i] += i; 14; } 15; 16target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64" 17 18define void @rmsmd(ptr %A, i32 %n) { 19entry: 20 br label %for.cond 21 22for.cond: ; preds = %for.inc4, %entry 23 %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ] 24 %mul = shl nsw i32 %n, 1 25 %cmp = icmp slt i32 %i.0, %mul 26 br i1 %cmp, label %for.body, label %for.end6 27 28for.body: ; preds = %for.cond 29 br label %for.cond1 30 31for.cond1: ; preds = %for.inc, %for.body 32 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ] 33 %exitcond = icmp ne i32 %j.0, 1024 34 br i1 %exitcond, label %for.body3, label %for.end 35 36for.body3: ; preds = %for.cond1 37 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.0 38 %tmp = load i32, ptr %arrayidx, align 4 39 %add = add nsw i32 %tmp, %i.0 40 store i32 %add, ptr %arrayidx, align 4 41 br label %for.inc 42 43for.inc: ; preds = %for.body3 44 %inc = add nsw i32 %j.0, 1 45 br label %for.cond1 46 47for.end: ; preds = %for.cond1 48 br label %for.inc4 49 50for.inc4: ; preds = %for.end 51 %inc5 = add nsw i32 %i.0, 1 52 br label %for.cond 53 54for.end6: ; preds = %for.cond 55 ret void 56} 57