• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-codegen-ppcg -S < %s | \
2; RUN: FileCheck %s -check-prefix=IR
3;
4; REQUIRES: pollyacc
5;
6;    void foo(long n, float A[][32]) {
7;      for (long i = 0; i < n; i++)
8;        for (long j = 0; j < n; j++)
9;          A[i][j] += A[i + 1][j + 1];
10;    }
11
12; IR:       %tmp = icmp slt i64 %i.0, %n
13; IR-NEXT:  br i1 %tmp, label %bb2, label %polly.merge_new_and_old
14
15target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
16
17define void @foo(i64 %n, [32 x float]* %A) {
18bb:
19  br label %bb1
20
21bb1:                                              ; preds = %bb15, %bb
22  %i.0 = phi i64 [ 0, %bb ], [ %tmp16, %bb15 ]
23  %tmp = icmp slt i64 %i.0, %n
24  br i1 %tmp, label %bb2, label %bb17
25
26bb2:                                              ; preds = %bb1
27  br label %bb3
28
29bb3:                                              ; preds = %bb12, %bb2
30  %j.0 = phi i64 [ 0, %bb2 ], [ %tmp13, %bb12 ]
31  %exitcond = icmp ne i64 %j.0, %n
32  br i1 %exitcond, label %bb4, label %bb14
33
34bb4:                                              ; preds = %bb3
35  %tmp5 = add nuw nsw i64 %j.0, 1
36  %tmp6 = add nuw nsw i64 %i.0, 1
37  %tmp7 = getelementptr inbounds [32 x float], [32 x float]* %A, i64 %tmp6, i64 %tmp5
38  %tmp8 = load float, float* %tmp7, align 4
39  %tmp9 = getelementptr inbounds [32 x float], [32 x float]* %A, i64 %i.0, i64 %j.0
40  %tmp10 = load float, float* %tmp9, align 4
41  %tmp11 = fadd float %tmp10, %tmp8
42  store float %tmp11, float* %tmp9, align 4
43  br label %bb12
44
45bb12:                                             ; preds = %bb4
46  %tmp13 = add nuw nsw i64 %j.0, 1
47  br label %bb3
48
49bb14:                                             ; preds = %bb3
50  br label %bb15
51
52bb15:                                             ; preds = %bb14
53  %tmp16 = add nuw nsw i64 %i.0, 1
54  br label %bb1
55
56bb17:                                             ; preds = %bb1
57  ret void
58}
59