• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -basic-aa -polly-ast -analyze < %s | FileCheck %s
2; RUN: opt %loadPolly -basic-aa -polly-import-jscop \
3; RUN:   -polly-ast-print-accesses \
4; RUN:   -polly-ast -polly-ast-detect-parallel -analyze < %s | FileCheck %s \
5; RUN:   -check-prefix=CHECK-VECTOR
6
7; for (i = 0; i < 1024; i++)
8;   A[i] = B[i];
9
10target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
11
12define void @single_loop_strip_mine(i16* noalias %A, i16* noalias %B) {
13entry:
14  br label %for.cond
15
16for.cond:                                         ; preds = %for.body, %entry
17  %indvar = phi i64 [ 0, %entry ], [ %inc, %for.body ]
18  %cmp = icmp slt i64 %indvar, 1024
19  br i1 %cmp, label %for.body, label %for.end
20
21for.body:                                         ; preds = %for.cond
22  %arrayidx = getelementptr inbounds i16, i16* %B, i64 0
23  %load = load i16, i16* %arrayidx
24  %add10 = add nsw i16 %load, 1
25  %arrayidx13 = getelementptr inbounds i16, i16* %A, i64 %indvar
26  store i16 %add10, i16* %arrayidx13, align 2
27  %inc = add nsw i64 %indvar, 1
28  br label %for.cond
29
30for.end:                                          ; preds = %for.cond
31  ret void
32}
33
34; CHECK: for (int c0 = 0; c0 <= 1023; c0 += 1)
35; CHECK:     Stmt_for_body(c0);
36
37; CHECK-VECTOR: #pragma known-parallel
38; CHECK-VECTOR: for (int c0 = 0; c0 <= 1023; c0 += 4)
39; CHECK-VECTOR:     #pragma simd
40; CHECK-VECTOR:     for (int c1 = c0; c1 <= c0 + 3; c1 += 1)
41; CHECK-VECTOR:       Stmt_for_body(
42; CHECK-VECTOR:         /* read  */ &MemRef_B[0]
43; CHECK-VECTOR:         /* write */  MemRef_A[c1]
44; CHECK-VECTOR:       );
45
46