• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-delicm -pass-remarks-missed=polly-delicm -disable-output < %s 2>&1 | FileCheck %s
2;
3; llvm.org/PR34485
4; llvm.org/PR34989
5;
6; The memset causes the array A to be divided into i8-sized subelements.
7; The the regular store then writes multiple of these subelements, which
8; we do not support currently.
9;
10;    void func(double *A) {
11;      memset(A, 0, 4);
12;      for (int j = 0; j < 2; j += 1) { /* outer */
13;        double phi = 0.0;
14;        for (int i = 0; i < 4; i += 1) /* reduction */
15;          phi += 4.2;
16;        A[j] = phi;
17;      }
18;    }
19
20declare void @llvm.memset.p0f64.i64(double* nocapture, i8, i64, i32, i1)
21
22define void @func(double* noalias nonnull %A) {
23entry:
24  br label %outer.for
25
26outer.for:
27  %j = phi i32 [0, %entry], [%j.inc, %outer.inc]
28  call void @llvm.memset.p0f64.i64(double* %A, i8 0, i64 4, i32 1, i1 false)
29  %j.cmp = icmp slt i32 %j, 2
30  br i1 %j.cmp, label %reduction.for, label %outer.exit
31
32
33    reduction.for:
34      %i = phi i32 [0, %outer.for], [%i.inc, %reduction.inc]
35      %phi = phi double [0.0, %outer.for], [%add, %reduction.inc]
36      %i.cmp = icmp slt i32 %i, 4
37      br i1 %i.cmp, label %body, label %reduction.exit
38
39
40
41        body:
42          %add = fadd double %phi, 4.2
43          br label %reduction.inc
44
45
46
47    reduction.inc:
48      %i.inc = add nuw nsw i32 %i, 1
49      br label %reduction.for
50
51    reduction.exit:
52      %A_idx = getelementptr inbounds double, double* %A, i32 %j
53      store double %phi, double* %A_idx
54      br label %outer.inc
55
56
57
58outer.inc:
59  %j.inc = add nuw nsw i32 %j, 1
60  br label %outer.for
61
62outer.exit:
63  br label %return
64
65return:
66  ret void
67}
68
69
70; CHECK: skipped possible mapping target because it writes more than one element
71