1; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
2;
3; The domain of bb14 contradicts the SCoP's assumptions. This leads to
4; 'anything goes' inside the statement since it is never executed,
5; including changing a memory write inside to
6;   [p_0, arg1] -> { Stmt_bb14[i0] -> MemRef_tmp[o0] : false }
7; (i.e.: never write)
8;
9target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
10
11define void @f(i16* %arg, i32 %arg1) {
12bb:
13  %tmp = alloca [24 x i32], align 4
14  br label %bb2
15
16bb2:
17  %tmp3 = phi i32 [ 0, %bb ], [ %tmp32, %bb34 ]
18  br i1 true, label %bb5, label %bb4
19
20bb4:
21  br label %bb24
22
23bb5:
24  %tmp6 = sub nsw i32 %arg1, %tmp3
25  %tmp7 = add i32 %tmp6, -1
26  %tmp8 = icmp eq i32 %tmp3, 0
27  %tmp9 = getelementptr inbounds i16, i16* %arg, i32 0
28  br i1 %tmp8, label %bb13, label %bb10
29
30bb10:
31  %tmp11 = getelementptr inbounds i16, i16* %tmp9, i32 %tmp7
32  %tmp12 = load i16, i16* %tmp11, align 2
33  br label %bb14
34
35bb13:
36  br label %bb31
37
38bb14:
39  %tmp15 = phi i32 [ 0, %bb10 ], [ %tmp21, %bb14 ]
40  %tmp16 = phi i16 [ undef, %bb10 ], [ %tmp19, %bb14 ]
41  %tmp17 = getelementptr inbounds [24 x i32], [24 x i32]* %tmp, i32 0, i32 %tmp15
42  %tmp18 = getelementptr inbounds i16, i16* %tmp9, i32 0
43  %tmp19 = load i16, i16* %tmp18, align 2
44  store i32 undef, i32* %tmp17, align 4
45  %tmp20 = call i32 asm "#", "=r,r"(i16 %tmp19) readnone
46  %tmp21 = add nuw nsw i32 %tmp15, 1
47  %tmp22 = icmp eq i32 %tmp21, %tmp3
48  br i1 %tmp22, label %bb23, label %bb14
49
50bb23:
51  br label %bb31
52
53bb24:
54  %tmp25 = phi i32 [ %tmp30, %bb24 ], [ 0, %bb4 ]
55  %tmp26 = mul nsw i32 %tmp25, %arg1
56  %tmp27 = getelementptr inbounds i16, i16* %arg, i32 %tmp26
57  %tmp28 = getelementptr inbounds i16, i16* %tmp27, i32 0
58  %tmp29 = load i16, i16* %tmp28, align 2
59  %tmp30 = add nuw nsw i32 %tmp25, 1
60  br i1 false, label %bb31, label %bb24
61
62bb31:
63  %tmp32 = add nuw nsw i32 %tmp3, 1
64  br i1 undef, label %bb34, label %bb33
65
66bb33:
67  unreachable
68
69bb34:
70  br label %bb2
71}
72
73
74; CHECK:      Stmt_bb14
75; CHECK:        MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
76; CHECK-NEXT:            [p_0, arg1] -> { Stmt_bb14[i0] -> MemRef_tmp16__phi[] };
77; CHECK-NEXT:       new: [p_0, arg1] -> { Stmt_bb14[i0] -> MemRef_tmp[o0] : false };
78