[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / polly / test / ScheduleOptimizer / tile_after_fusion.ll
blob8e5849234af60e471a072c3642e14a5e6684cc80
1 ; RUN: opt %loadPolly -polly-isl-arg=--no-schedule-serialize-sccs -polly-opt-isl -polly-print-ast -disable-output < %s | FileCheck %s
4 ;    void tf(int C[256][256][256], int A0[256][256][256], int A1[256][256][256]) {
5 ;      for (int i = 0; i < 256; ++i)
6 ;        for (int j = 0; j < 256; ++j)
7 ;          for (int k = 0; k < 256; ++k)
8 ;            C[i][j][k] += A0[i][j][k];
10 ;      for (int i = 0; i < 256; ++i)
11 ;        for (int j = 0; j < 256; ++j)
12 ;          for (int k = 0; k < 256; ++k)
13 ;            C[i][j][k] += A1[i][j][k];
14 ;    }
16 ; The tile_after_fusion.ll test has two statements in separate loop nests and
17 ; checks whether they are tiled after being fused when polly-opt-fusion equals
18 ; "max".
20 ; CHECK-LABEL: Printing analysis 'Polly - Generate an AST from the SCoP (isl)' for region: 'for.cond => for.end56' in function 'tf':
21 ; CHECK:       1st level tiling - Tiles
22 ; CHECK-NEXT:     for (int c0 = 0; c0 <= 7; c0 += 1)
23 ; CHECK-NEXT:       for (int c1 = 0; c1 <= 7; c1 += 1)
24 ; CHECK-NEXT:         for (int c2 = 0; c2 <= 7; c2 += 1) {
25 ; CHECK-NEXT:           // 1st level tiling - Points
26 ; CHECK-NEXT:           for (int c3 = 0; c3 <= 31; c3 += 1)
27 ; CHECK-NEXT:             for (int c4 = 0; c4 <= 31; c4 += 1)
28 ; CHECK-NEXT:               for (int c5 = 0; c5 <= 31; c5 += 1) {
29 ; CHECK-NEXT:                 Stmt_for_body6(32 * c0 + c3, 32 * c1 + c4, 32 * c2 + c5);
30 ; CHECK-NEXT:                 Stmt_for_body34(32 * c0 + c3, 32 * c1 + c4, 32 * c2 + c5);
32 source_filename = "tile_after_fusion.c"
33 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
35 define void @tf(ptr %C, ptr %A0, ptr %A1) {
36 entry:
37   br label %for.cond
39 for.cond:                                         ; preds = %for.inc20, %entry
40   %indvars.iv13 = phi i64 [ %indvars.iv.next14, %for.inc20 ], [ 0, %entry ]
41   %exitcond15 = icmp ne i64 %indvars.iv13, 256
42   br i1 %exitcond15, label %for.body, label %for.end22
44 for.body:                                         ; preds = %for.cond
45   br label %for.cond1
47 for.cond1:                                        ; preds = %for.inc17, %for.body
48   %indvars.iv10 = phi i64 [ %indvars.iv.next11, %for.inc17 ], [ 0, %for.body ]
49   %exitcond12 = icmp ne i64 %indvars.iv10, 256
50   br i1 %exitcond12, label %for.body3, label %for.end19
52 for.body3:                                        ; preds = %for.cond1
53   br label %for.cond4
55 for.cond4:                                        ; preds = %for.inc, %for.body3
56   %indvars.iv7 = phi i64 [ %indvars.iv.next8, %for.inc ], [ 0, %for.body3 ]
57   %exitcond9 = icmp ne i64 %indvars.iv7, 256
58   br i1 %exitcond9, label %for.body6, label %for.end
60 for.body6:                                        ; preds = %for.cond4
61   %arrayidx10 = getelementptr inbounds [256 x [256 x i32]], ptr %A0, i64 %indvars.iv13, i64 %indvars.iv10, i64 %indvars.iv7
62   %tmp = load i32, ptr %arrayidx10, align 4
63   %arrayidx16 = getelementptr inbounds [256 x [256 x i32]], ptr %C, i64 %indvars.iv13, i64 %indvars.iv10, i64 %indvars.iv7
64   %tmp16 = load i32, ptr %arrayidx16, align 4
65   %add = add nsw i32 %tmp16, %tmp
66   store i32 %add, ptr %arrayidx16, align 4
67   br label %for.inc
69 for.inc:                                          ; preds = %for.body6
70   %indvars.iv.next8 = add nuw nsw i64 %indvars.iv7, 1
71   br label %for.cond4
73 for.end:                                          ; preds = %for.cond4
74   br label %for.inc17
76 for.inc17:                                        ; preds = %for.end
77   %indvars.iv.next11 = add nuw nsw i64 %indvars.iv10, 1
78   br label %for.cond1
80 for.end19:                                        ; preds = %for.cond1
81   br label %for.inc20
83 for.inc20:                                        ; preds = %for.end19
84   %indvars.iv.next14 = add nuw nsw i64 %indvars.iv13, 1
85   br label %for.cond
87 for.end22:                                        ; preds = %for.cond
88   br label %for.cond24
90 for.cond24:                                       ; preds = %for.inc54, %for.end22
91   %indvars.iv4 = phi i64 [ %indvars.iv.next5, %for.inc54 ], [ 0, %for.end22 ]
92   %exitcond6 = icmp ne i64 %indvars.iv4, 256
93   br i1 %exitcond6, label %for.body26, label %for.end56
95 for.body26:                                       ; preds = %for.cond24
96   br label %for.cond28
98 for.cond28:                                       ; preds = %for.inc51, %for.body26
99   %indvars.iv1 = phi i64 [ %indvars.iv.next2, %for.inc51 ], [ 0, %for.body26 ]
100   %exitcond3 = icmp ne i64 %indvars.iv1, 256
101   br i1 %exitcond3, label %for.body30, label %for.end53
103 for.body30:                                       ; preds = %for.cond28
104   br label %for.cond32
106 for.cond32:                                       ; preds = %for.inc48, %for.body30
107   %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc48 ], [ 0, %for.body30 ]
108   %exitcond = icmp ne i64 %indvars.iv, 256
109   br i1 %exitcond, label %for.body34, label %for.end50
111 for.body34:                                       ; preds = %for.cond32
112   %arrayidx40 = getelementptr inbounds [256 x [256 x i32]], ptr %A1, i64 %indvars.iv4, i64 %indvars.iv1, i64 %indvars.iv
113   %tmp17 = load i32, ptr %arrayidx40, align 4
114   %arrayidx46 = getelementptr inbounds [256 x [256 x i32]], ptr %C, i64 %indvars.iv4, i64 %indvars.iv1, i64 %indvars.iv
115   %tmp18 = load i32, ptr %arrayidx46, align 4
116   %add47 = add nsw i32 %tmp18, %tmp17
117   store i32 %add47, ptr %arrayidx46, align 4
118   br label %for.inc48
120 for.inc48:                                        ; preds = %for.body34
121   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
122   br label %for.cond32
124 for.end50:                                        ; preds = %for.cond32
125   br label %for.inc51
127 for.inc51:                                        ; preds = %for.end50
128   %indvars.iv.next2 = add nuw nsw i64 %indvars.iv1, 1
129   br label %for.cond28
131 for.end53:                                        ; preds = %for.cond28
132   br label %for.inc54
134 for.inc54:                                        ; preds = %for.end53
135   %indvars.iv.next5 = add nuw nsw i64 %indvars.iv4, 1
136   br label %for.cond24
138 for.end56:                                        ; preds = %for.cond24
139   ret void