1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-delicm -disable-output < %s | FileCheck -match-full-lines %s
2 ; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-delicm>)" -disable-output < %s | FileCheck -match-full-lines %s
4 ; Check that PHI mapping works even in presence of a memset whose'
7 declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1)
9 define void @func(ptr noalias nonnull %A) {
14 %j = phi i32 [0, %entry], [%j.inc, %outer.inc]
15 %j.cmp = icmp slt i32 %j, 2
16 br i1 %j.cmp, label %bodyA, label %outer.exit
20 %A_idx = getelementptr inbounds i8, ptr %A, i32 %j
21 %cond = icmp eq i32 21, 21
22 br i1 %cond, label %bodyB, label %bodyC
25 call void @llvm.memset.p0.i64(ptr %A_idx, i8 0, i64 1, i32 1, i1 false)
29 %phi = phi i8 [1, %bodyA], [0, %bodyB]
30 %a = load i8, ptr %A_idx
31 store i8 %phi, ptr %A_idx
36 %j.inc = add nuw nsw i32 %j, 1
48 ; CHECK: Compatible overwrites: 1
49 ; CHECK: Overwrites mapped to: 1
50 ; CHECK: PHI scalars mapped: 1
53 ; CHECK: After accesses {
54 ; CHECK-NEXT: Stmt_bodyA
55 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
56 ; CHECK-NEXT: { Stmt_bodyA[i0] -> MemRef_phi__phi[] };
57 ; CHECK-NEXT: new: { Stmt_bodyA[i0] -> MemRef_A[o0] : false };
58 ; CHECK-NEXT: Stmt_bodyB
59 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
60 ; CHECK-NEXT: { Stmt_bodyB[i0] -> MemRef_A[i0] };
61 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
62 ; CHECK-NEXT: { Stmt_bodyB[i0] -> MemRef_phi__phi[] };
63 ; CHECK-NEXT: new: { Stmt_bodyB[i0] -> MemRef_A[i0] };
64 ; CHECK-NEXT: Stmt_bodyC
65 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
66 ; CHECK-NEXT: { Stmt_bodyC[i0] -> MemRef_phi__phi[] };
67 ; CHECK-NEXT: new: { Stmt_bodyC[i0] -> MemRef_A[i0] };
68 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
69 ; CHECK-NEXT: { Stmt_bodyC[i0] -> MemRef_A[i0] };
70 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
71 ; CHECK-NEXT: { Stmt_bodyC[i0] -> MemRef_A[i0] };