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.exit.true avoids that anything can be mapped to
15 ; A[j] because it would be overwritten by that MAY_WRITE just before the final
16 ; MUST_WRITE. Also nothing can be map to the MAY_WRITE itself because it is a
19 define void @func(ptr noalias nonnull %A) {
21 %fsomeval = fadd double 21.0, 21.0
22 br label %outer.preheader
28 %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
29 %j.cmp = icmp slt i32 %j, 2
30 br i1 %j.cmp, label %reduction.preheader, label %outer.exit
34 br label %reduction.for
37 %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
38 %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
39 %i.cmp = icmp slt i32 %i, 4
40 br i1 %i.cmp, label %body, label %reduction.exit
45 %add = fadd double %phi, 4.2
46 br label %reduction.inc
51 %i.inc = add nuw nsw i32 %i, 1
52 br label %reduction.for
55 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
56 %phi.cmp = fcmp ogt double %phi, 0.0
57 br i1 %phi.cmp, label %reduction.exit.true, label %reduction.exit.unconditional
60 store double undef, ptr %A_idx
61 br label %reduction.exit.unconditional
63 reduction.exit.unconditional:
64 store double %phi, ptr %A_idx
70 %j.inc = add nuw nsw i32 %j, 1
82 ; CHECK: Compatible overwrites: 1
84 ; CHECK: No modification has been made