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 */
5 ; fsomeval = 21.0 + 21.0;
7 ; for (int i = 0; i < 4; i += 1) /* reduction */
14 ; Check that fsomeval is not mapped to A[j] because it is escaping the SCoP.
15 ; Supporting this would require reloading the scalar from A[j], and/or
16 ; identifying the last instance of fsomeval that escapes.
18 define void @func(ptr noalias nonnull %A) {
20 br label %outer.preheader
26 %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
27 %j.cmp = icmp slt i32 %j, 2
28 %fsomeval = fadd double 21.0, 21.0
29 br i1 %j.cmp, label %reduction.preheader, label %outer.exit
33 br label %reduction.for
36 %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
37 %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
38 %i.cmp = icmp slt i32 %i, 4
39 br i1 %i.cmp, label %body, label %reduction.exit
44 %add = fadd double %phi, 4.2
45 br label %reduction.inc
50 %i.inc = add nuw nsw i32 %i, 1
51 br label %reduction.for
54 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
55 store double %fsomeval, ptr %A_idx
61 %j.inc = add nuw nsw i32 %j, 1
68 call void @g(double %fsomeval)
72 declare void @g(double)
76 ; CHECK: Compatible overwrites: 1
78 ; CHECK: No modification has been made