brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · e828696 Raw
67 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK:      Context:4; CHECK-NEXT: {  :  }5; CHECK:      Assumed Context:6; CHECK-NEXT: {  :  }7; CHECK:      Invalid Context:8; CHECK-NEXT: {  : false }9; CHECK:      Statements {10; CHECK-NEXT:     Stmt_for_body11; CHECK-NEXT:         Domain :=12; CHECK-NEXT:             { Stmt_for_body[i0] : 0 <= i0 <= 99 };13; CHECK-NEXT:         Schedule :=14; CHECK-NEXT:             { Stmt_for_body[i0] -> [i0] };15; CHECK-NEXT:         ReadAccess :=    [Reduction Type: +] [Scalar: 0]16; CHECK-NEXT:             { Stmt_for_body[i0] -> MemRef_A[i0, 0] };17; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: +] [Scalar: 0]18; CHECK-NEXT:             { Stmt_for_body[i0] -> MemRef_A[i0, 0] };19; CHECK-NEXT:         ReadAccess :=    [Reduction Type: +] [Scalar: 0]20; CHECK-NEXT:             { Stmt_for_body[i0] -> MemRef_A[1 + i0, 0] };21; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: +] [Scalar: 0]22; CHECK-NEXT:             { Stmt_for_body[i0] -> MemRef_A[1 + i0, 0] };23; CHECK-NEXT: }24;25;    void f(int A[][2]) {26;      int(*B)[2] = &A[0][0];27;      int(*C)[2] = &A[1][0];28;      for (int i = 0; i < 100; i++) {29;        B[i][0]++;30;        C[i][0]++;31;      }32;    }33;34; Verify that the additional offset to A by accessing it through C is taken into35; account.36;37target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"38 39define void @f(ptr %A) {40entry:41  %arrayidx3 = getelementptr inbounds [2 x i32], ptr %A, i64 1, i64 042  br label %for.cond43 44for.cond:                                         ; preds = %for.inc, %entry45  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]46  %exitcond = icmp ne i64 %indvars.iv, 10047  br i1 %exitcond, label %for.body, label %for.end48 49for.body:                                         ; preds = %for.cond50  %arrayidx5 = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv, i64 051  %tmp1 = load i32, ptr %arrayidx5, align 452  %inc = add nsw i32 %tmp1, 153  store i32 %inc, ptr %arrayidx5, align 454  %arrayidx8 = getelementptr inbounds [2 x i32], ptr %arrayidx3, i64 %indvars.iv, i64 055  %tmp2 = load i32, ptr %arrayidx8, align 456  %inc9 = add nsw i32 %tmp2, 157  store i32 %inc9, ptr %arrayidx8, align 458  br label %for.inc59 60for.inc:                                          ; preds = %for.body61  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 162  br label %for.cond63 64for.end:                                          ; preds = %for.cond65  ret void66}67