87 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<deps>' -polly-print-deps -disable-output < %s | FileCheck %s2;3; CHECK: RAW dependences:4; CHECK-NEXT: { Stmt_S1[i0, 0] -> Stmt_S2[i0, 0] : 0 <= i0 <= 98; Stmt_S2[i0, 0] -> Stmt_S1[1 + i0, 0] : 0 <= i0 <= 97 }5; CHECK-NEXT: WAR dependences:6; CHECK-NEXT: { Stmt_S1[i0, 0] -> Stmt_S2[i0, 0] : 0 <= i0 <= 98; Stmt_S2[i0, 0] -> Stmt_S1[1 + i0, 0] : 0 <= i0 <= 97 }7; CHECK-NEXT: WAW dependences:8; CHECK-NEXT: { Stmt_S1[i0, 0] -> Stmt_S2[i0, 0] : 0 <= i0 <= 98; Stmt_S2[i0, 0] -> Stmt_S1[1 + i0, 0] : 0 <= i0 <= 97 }9; CHECK-NEXT: Reduction dependences:10; CHECK-NEXT: { Stmt_S2[i0, i1] -> Stmt_S2[1 + i0, i1] : 0 <= i0 <= 97 and 0 < i1 <= 99 }11;12; void f(int *sum) {13; for (int i = 0; i < 99; i++) {14; for (int j = 0; j < 1; j++)15; S1: sum[j] += 42;16; for (int j = 0; j < 100; j++)17; S2: sum[j] += i * j;18; }19; }20;21target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"22 23define void @f(ptr %sum) {24entry:25 br label %for.cond26 27for.cond: ; preds = %for.inc12, %entry28 %i.0 = phi i32 [ 0, %entry ], [ %inc13, %for.inc12 ]29 %exitcond2 = icmp ne i32 %i.0, 9930 br i1 %exitcond2, label %for.body, label %for.end1431 32for.body: ; preds = %for.cond33 br label %for.cond134 35for.cond1: ; preds = %for.inc, %for.body36 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]37 %exitcond = icmp ne i32 %j.0, 138 br i1 %exitcond, label %for.body3, label %for.end39 40for.body3: ; preds = %for.cond141 br label %S142 43S1: ; preds = %for.body344 %arrayidx = getelementptr inbounds i32, ptr %sum, i32 %j.045 %tmp = load i32, ptr %arrayidx, align 446 %add = add nsw i32 %tmp, 4247 store i32 %add, ptr %arrayidx, align 448 br label %for.inc49 50for.inc: ; preds = %S151 %inc = add nsw i32 %j.0, 152 br label %for.cond153 54for.end: ; preds = %for.cond155 br label %for.cond456 57for.cond4: ; preds = %for.inc9, %for.end58 %j.1 = phi i32 [ 0, %for.end ], [ %inc10, %for.inc9 ]59 %exitcond1 = icmp ne i32 %j.1, 10060 br i1 %exitcond1, label %for.body6, label %for.end1161 62for.body6: ; preds = %for.cond463 br label %S264 65S2: ; preds = %for.body666 %mul = mul nsw i32 %i.0, %j.167 %arrayidx7 = getelementptr inbounds i32, ptr %sum, i32 %j.168 %tmp3 = load i32, ptr %arrayidx7, align 469 %add8 = add nsw i32 %tmp3, %mul70 store i32 %add8, ptr %arrayidx7, align 471 br label %for.inc972 73for.inc9: ; preds = %S274 %inc10 = add nsw i32 %j.1, 175 br label %for.cond476 77for.end11: ; preds = %for.cond478 br label %for.inc1279 80for.inc12: ; preds = %for.end1181 %inc13 = add nsw i32 %i.0, 182 br label %for.cond83 84for.end14: ; preds = %for.cond85 ret void86}87