67 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<import-jscop;ast>' -polly-print-ast -polly-ast-detect-parallel -disable-output < %s | FileCheck %s2;3; CHECK-NOT: #pragma simd{{\s*$}}4; CHECK: #pragma simd reduction5; CHECK: Stmt_S0(n - c1)6; CHECK: #pragma simd{{\s*$}}7; CHECK: Stmt_S1(n - c1)8;9; void rlr(int *A, long n) {10; for (long i = 0; i < 2 * n; i++)11; S0: A[0] += i;12; for (long i = 0; i < 2 * n; i++)13; S1: A[i + 1] = 1;14; }15;16target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"17 18define void @rlr(ptr %A, i32 %n) {19entry:20 br label %for.cond21 22for.cond: ; preds = %for.inc, %entry23 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]24 %mul = shl nsw i32 %n, 125 %cmp = icmp slt i32 %i.0, %mul26 br i1 %cmp, label %for.body, label %for.end27 28for.body: ; preds = %for.cond29 br label %S030 31S0: ; preds = %for.body32 %tmp = load i32, ptr %A, align 433 %add = add nsw i32 %tmp, %i.034 store i32 %add, ptr %A, align 435 br label %for.inc36 37for.inc: ; preds = %S038 %inc = add nsw i32 %i.0, 139 br label %for.cond40 41for.end: ; preds = %for.cond42 br label %for.cond243 44for.cond2: ; preds = %for.inc8, %for.end45 %i1.0 = phi i32 [ 0, %for.end ], [ %inc9, %for.inc8 ]46 %mul3 = shl nsw i32 %n, 147 %cmp4 = icmp slt i32 %i1.0, %mul348 br i1 %cmp4, label %for.body5, label %for.end1049 50for.body5: ; preds = %for.cond251 br label %S152 53S1: ; preds = %for.body554 %add6 = add nsw i32 %i1.0, 155 %arrayidx7 = getelementptr inbounds i32, ptr %A, i32 %add656 store i32 1, ptr %arrayidx7, align 457 br label %for.inc858 59for.inc8: ; preds = %S160 %inc9 = add nsw i32 %i1.0, 161 br label %for.cond262 63for.end10: ; preds = %for.cond264 ret void65}66 67