1 ; RUN: opt %loadPolly -polly-print-delicm -disable-output < %s | FileCheck %s
3 ; void func(double *A) {
4 ; for (int j = 0; j < 2; j += 1) { /* outer */
6 ; for (int i = 0; i < 4; i += 1) /* reduction */
14 ; The MAY_WRITE in reduction.for.true conflict with a write of %phi to
15 ; A[j] if %phi would be mapped to it. Being a MAY_WRITE avoids being target
16 ; of a mapping itself.
18 ; TODO: There is actually no reason why these conflict. The MAY_WRITE is an
19 ; explicit write, defined to occur always before all implicit writes as the
20 ; write of %phi would be. There is currently no differentiation between
21 ; implicit and explicit writes in Polly.
23 define void @func(ptr noalias nonnull %A) {
25 %fsomeval = fadd double 21.0, 21.0
26 br label %outer.preheader
32 %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
33 %j.cmp = icmp slt i32 %j, 2
34 br i1 %j.cmp, label %reduction.preheader, label %outer.exit
38 br label %reduction.for
41 %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
42 %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
43 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
44 %phi.cmp = fcmp ogt double %phi, 0.0
45 br i1 %phi.cmp, label %reduction.for.true, label %reduction.for.unconditional
48 store double undef, ptr %A_idx
49 br label %reduction.for.unconditional
51 reduction.for.unconditional:
52 %i.cmp = icmp slt i32 %i, 4
53 br i1 %i.cmp, label %body, label %reduction.exit
58 %add = fadd double %phi, 4.2
59 br label %reduction.inc
64 %i.inc = add nuw nsw i32 %i, 1
65 br label %reduction.for
68 store double %phi, ptr %A_idx
74 %j.inc = add nuw nsw i32 %j, 1
86 ; CHECK: Compatible overwrites: 1
88 ; CHECK: No modification has been made