1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze < %s | FileCheck %s 2; 3; void g(); 4; int f(int *A) { 5; int a0 = 0, a1 = 0, a2 = 0; 6; for (int i = 0; i < 1000; i++) { 7; a0 = 2 * i; 8; // split 9; A[0] = i; 10; a1 = 2 * i; 11; // split 12; a2 = 2 * i; 13; } 14; g(); 15; return a1 + a2; 16; } 17; 18; CHECK: Stmt_bb1 19; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 20; CHECK: { Stmt_bb1[i0] -> MemRef_a_0[] }; 21; CHECK: Stmt_bb2 22; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 23; CHECK: { Stmt_bb2[i0] -> MemRef_a_1[] }; 24; CHECK: Stmt_bb3 25; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 26; CHECK: { Stmt_bb3[i0] -> MemRef_a_2[] }; 27 28target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 29 30define i32 @f(i32* %A) { 31bb: 32 br label %bb1 33 34bb1: ; preds = %bb3, %bb 35 %i.0 = phi i32 [ 0, %bb ], [ %tmp4, %bb3 ] 36 %a.0 = mul i32 %i.0, 2 37 br label %bb2 38 39bb2: ; preds = %bb1 40 %a.1 = mul i32 %i.0, 2 41 store i32 %i.0, i32 *%A, align 4 42 br label %bb3 43 44bb3: ; preds = %bb2 45 %tmp = shl nsw i32 %i.0, 1 46 %tmp4 = add nuw nsw i32 %i.0, 1 47 %a.2 = mul i32 %i.0, 2 48 %exitcond = icmp ne i32 %i.0, 1000 49 br i1 %exitcond, label %bb1, label %bb5 50 51bb5: ; preds = %bb1 52 call void (...) @g() #2 53 %add = add i32 %a.0, %a.1 54 %add2 = add i32 %add, %a.2 55 ret i32 %add2 56} 57 58declare void @g(...) #1 59