brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 9875257 Raw
68 lines · plain
1; RUN: opt -S %loadNPMPolly '-passes=polly-custom<deps>' -polly-print-deps -disable-output < %s | FileCheck %s -check-prefix=VALUE2target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"3 4;                     for (int i = 0; i < N; i++) {5; A.must.write.20:      A[i] = 20;6;7; compute.i.square:    if (i * i)8; A.may.write.90:         A[i] = 90;9;10; B.write.from.A:       B[i] = A[i];11; A.must.write.42:      A[i] = 42;12;                     }13define void @f(ptr %A, ptr %B) {14entry:15  br label %for.cond16 17for.cond:                                         ; preds = %for.inc, %entry18  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]19  %exitcond = icmp ne i64 %indvars.iv, 300020  br i1 %exitcond, label %A.must.write.20, label %for.end21 22A.must.write.20:23  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv24  store i32 20, ptr %arrayidx, align 425  br label %compute.i.square26 27compute.i.square:28  %tmp = mul nsw i64 %indvars.iv, %indvars.iv29  %tmp2 = trunc i64 %tmp to i3230  %tobool = icmp eq i32 %tmp2, 031  br i1 %tobool, label %B.write.from.A, label %A.may.write.9032 33A.may.write.90:34  %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv35  store i32 90, ptr %arrayidx2, align 436  br label %B.write.from.A37 38B.write.from.A:39  %arrayidx4 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv40  %tmp3 = load i32, ptr %arrayidx4, align 441  %arrayidx6 = getelementptr inbounds i32, ptr %B, i64 %indvars.iv42  store i32 %tmp3, ptr %arrayidx6, align 443  br label %A.must.write.4244  ; br label %for.inc45 46A.must.write.42:47  %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv48  store i32 42, ptr %arrayidx5, align 449  br label %for.inc50 51for.inc:                                          ; preds = %if.end52  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 153  br label %for.cond54 55for.end:                                          ; preds = %for.cond56  ret void57}58; VALUE: RAW dependences:59; VALUE-NEXT:   { Stmt_compute_i_square__TO__B_write_from_A[i0] -> Stmt_B_write_from_A[i0] : 0 <= i0 <= 2999; Stmt_A_must_write_20[i0] -> Stmt_B_write_from_A[i0] : 0 <= i0 <= 2999 }60; VALUE-NEXT: WAR dependences:61; VALUE-NEXT:   { Stmt_B_write_from_A[i0] -> Stmt_A_must_write_42[i0] : 0 <= i0 <= 2999 }62; VALUE-NEXT: WAW dependences:63; VALUE-NEXT:   { Stmt_A_must_write_20[i0] -> Stmt_compute_i_square__TO__B_write_from_A[i0] : 0 <= i0 <= 2999; Stmt_compute_i_square__TO__B_write_from_A[i0] -> Stmt_A_must_write_42[i0] : 0 <= i0 <= 2999; Stmt_A_must_write_20[i0] -> Stmt_A_must_write_42[i0] : 0 <= i0 <= 2999 }64; VALUE-NEXT: Reduction dependences:65; VALUE-NEXT:   {  }66; VALUE-NEXT: Transitive closure of reduction dependences:67; VALUE-NEXT:   {  }68