1; RUN: opt %loadPolly -polly-stmt-granularity=scalar-indep -polly-print-instructions -polly-scops -analyze < %s | FileCheck %s -match-full-lines 2; 3; Split a block into two independent statements that share no scalar. 4; This case has an independent statement just for PHI writes. 5; 6; for (int j = 0; j < n; j += 1) { 7; bodyA: 8; double valA = A[0]; 9; A[0] = valA; 10; 11; bodyB: 12; phi = 42.0; 13; } 14; 15define void @func(i32 %n, double* noalias nonnull %A) { 16entry: 17 br label %for 18 19for: 20 %j = phi i32 [0, %entry], [%j.inc, %inc] 21 %j.cmp = icmp slt i32 %j, %n 22 br i1 %j.cmp, label %bodyA, label %exit 23 24 bodyA: 25 %valA = load double, double* %A 26 store double %valA, double* %A 27 br label %bodyB 28 29 bodyB: 30 %phi = phi double [42.0, %bodyA] 31 br label %inc 32 33inc: 34 %j.inc = add nuw nsw i32 %j, 1 35 br label %for 36 37exit: 38 br label %return 39 40return: 41 ret void 42} 43 44 45; CHECK: Statements { 46; CHECK-NEXT: Stmt_bodyA 47; CHECK-NEXT: Domain := 48; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] : 0 <= i0 < n }; 49; CHECK-NEXT: Schedule := 50; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> [i0, 0] }; 51; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0] 52; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_A[0] }; 53; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0] 54; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_A[0] }; 55; CHECK-NEXT: Instructions { 56; CHECK-NEXT: %valA = load double, double* %A, align 8 57; CHECK-NEXT: store double %valA, double* %A, align 8 58; CHECK-NEXT: } 59; CHECK-NEXT: Stmt_bodyA_last 60; CHECK-NEXT: Domain := 61; CHECK-NEXT: [n] -> { Stmt_bodyA_last[i0] : 0 <= i0 < n }; 62; CHECK-NEXT: Schedule := 63; CHECK-NEXT: [n] -> { Stmt_bodyA_last[i0] -> [i0, 1] }; 64; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 65; CHECK-NEXT: [n] -> { Stmt_bodyA_last[i0] -> MemRef_phi__phi[] }; 66; CHECK-NEXT: Instructions { 67; CHECK-NEXT: } 68; CHECK-NEXT: } 69