1 ; RUN: opt %loadPolly -polly-stmt-granularity=scalar-indep -polly-print-instructions -polly-print-scops -disable-output < %s | FileCheck %s -match-full-lines
3 ; Split a block into two independent statements that share no scalar.
4 ; This case has the instructions of the two statements interleaved, such that
5 ; splitting the BasicBlock in the middle would cause a scalar dependency.
7 ; for (int j = 0; j < n; j += 1) {
10 ; double valB = 21.0 + 21.0;
15 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {
20 %j = phi i32 [0, %entry], [%j.inc, %inc]
21 %j.cmp = icmp slt i32 %j, %n
22 br i1 %j.cmp, label %body, label %exit
25 %valA = load double, ptr %A
26 %valB = fadd double 21.0, 21.0
27 store double %valA, ptr %A
28 store double %valB, ptr %B
32 %j.inc = add nuw nsw i32 %j, 1
44 ; CHECK-NEXT: Stmt_body
45 ; CHECK-NEXT: Domain :=
46 ; CHECK-NEXT: [n] -> { Stmt_body[i0] : 0 <= i0 < n };
47 ; CHECK-NEXT: Schedule :=
48 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> [i0, 0] };
49 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
50 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };
51 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
52 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };
53 ; CHECK-NEXT: Instructions {
54 ; CHECK-NEXT: %valA = load double, ptr %A, align 8
55 ; CHECK-NEXT: store double %valA, ptr %A, align 8
57 ; CHECK-NEXT: Stmt_body_b
58 ; CHECK-NEXT: Domain :=
59 ; CHECK-NEXT: [n] -> { Stmt_body_b[i0] : 0 <= i0 < n };
60 ; CHECK-NEXT: Schedule :=
61 ; CHECK-NEXT: [n] -> { Stmt_body_b[i0] -> [i0, 1] };
62 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
63 ; CHECK-NEXT: [n] -> { Stmt_body_b[i0] -> MemRef_B[0] };
64 ; CHECK-NEXT: Instructions {
65 ; CHECK-NEXT: %valB = fadd double 2.100000e+01, 2.100000e+01
66 ; CHECK-NEXT: store double %valB, ptr %B, align 8