1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s 2; 3; CHECK: Reduction Type: + 4; CHECK: Reduction Type: + 5; CHECK: Reduction Type: * 6; CHECK: Reduction Type: * 7; 8; void f(int *sums) { 9; for (int i = 0; i < 1024; i++) { 10; for (int j = 0; j < 1024; j++) { 11; sums[i] += 5; 12; sums[i+1024] *= 5; 13; } 14; } 15; } 16target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64" 17 18define void @f(i32* %sums) { 19entry: 20 br label %for.cond 21 22for.cond: ; preds = %for.inc6, %entry 23 %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ] 24 %exitcond1 = icmp ne i32 %i.0, 1024 25 br i1 %exitcond1, label %for.body, label %for.end8 26 27for.body: ; preds = %for.cond 28 br label %for.cond1 29 30for.cond1: ; preds = %for.inc, %for.body 31 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ] 32 %exitcond = icmp ne i32 %j.0, 1024 33 br i1 %exitcond, label %for.body3, label %for.end 34 35for.body3: ; preds = %for.cond1 36 %arrayidx = getelementptr inbounds i32, i32* %sums, i32 %i.0 37 %tmp = load i32, i32* %arrayidx, align 4 38 %add = add nsw i32 %tmp, 5 39 store i32 %add, i32* %arrayidx, align 4 40 %add4 = add nsw i32 %i.0, 1024 41 %arrayidx5 = getelementptr inbounds i32, i32* %sums, i32 %add4 42 %tmp2 = load i32, i32* %arrayidx5, align 4 43 %mul = mul nsw i32 %tmp2, 5 44 store i32 %mul, i32* %arrayidx5, align 4 45 br label %for.inc 46 47for.inc: ; preds = %for.body3 48 %inc = add nsw i32 %j.0, 1 49 br label %for.cond1 50 51for.end: ; preds = %for.cond1 52 br label %for.inc6 53 54for.inc6: ; preds = %for.end 55 %inc7 = add nsw i32 %i.0, 1 56 br label %for.cond 57 58for.end8: ; preds = %for.cond 59 ret void 60} 61