1; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-simplify -analyze < %s | FileCheck %s -match-full-lines 2; 3; Remove redundant scalar stores. 4; 5; for (int j = 0; j < n; j += 1) { 6; bodyA: 7; double val = A[0]; 8; 9; bodyB: 10; A[0] = val; 11; } 12; 13define void @redundant_scalarwrite(i32 %n, double* noalias nonnull %A) { 14entry: 15 br label %for 16 17for: 18 %j = phi i32 [0, %entry], [%j.inc, %inc] 19 %j.cmp = icmp slt i32 %j, %n 20 br i1 %j.cmp, label %bodyA, label %exit 21 22 23 bodyA: 24 %val = load double, double* %A 25 br label %bodyB 26 27 bodyB: 28 store double %val, double* %A 29 br label %inc 30 31 32inc: 33 %j.inc = add nuw nsw i32 %j, 1 34 br label %for 35 36exit: 37 br label %return 38 39return: 40 ret void 41} 42 43 44; CHECK: Statistics { 45; CHECK: Redundant writes removed: 2 46; CHECK: } 47 48; CHECK: After accesses { 49; CHECK-NEXT: } 50