[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / polly / test / ScopInfo / multidim_fixedsize_multi_offset.ll
blob9c749f0c48c83418c2f4b2a4f40a728b85d13243
1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -disable-output < %s | FileCheck %s
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_body
11 ; 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: }
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 ;    }
34 ; Verify that the additional offset to A by accessing it through C is taken into
35 ; account.
37 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
39 define void @f(ptr %A) {
40 entry:
41   %arrayidx3 = getelementptr inbounds [2 x i32], ptr %A, i64 1, i64 0
42   br label %for.cond
44 for.cond:                                         ; preds = %for.inc, %entry
45   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
46   %exitcond = icmp ne i64 %indvars.iv, 100
47   br i1 %exitcond, label %for.body, label %for.end
49 for.body:                                         ; preds = %for.cond
50   %arrayidx5 = getelementptr inbounds [2 x i32], ptr %A, i64 %indvars.iv, i64 0
51   %tmp1 = load i32, ptr %arrayidx5, align 4
52   %inc = add nsw i32 %tmp1, 1
53   store i32 %inc, ptr %arrayidx5, align 4
54   %arrayidx8 = getelementptr inbounds [2 x i32], ptr %arrayidx3, i64 %indvars.iv, i64 0
55   %tmp2 = load i32, ptr %arrayidx8, align 4
56   %inc9 = add nsw i32 %tmp2, 1
57   store i32 %inc9, ptr %arrayidx8, align 4
58   br label %for.inc
60 for.inc:                                          ; preds = %for.body
61   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
62   br label %for.cond
64 for.end:                                          ; preds = %for.cond
65   ret void