1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; Should not be identified as reduction as there are different operations
4 ; involved on sum (multiplication followed by addition)
5 ; CHECK: Reduction Type: NONE
7 ; void f(int *restrict sum) {
8 ; for (int i = 0; i < 1024; i++) {
9 ; *sum = (*sum * 5) + 25;
13 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
15 define void @f(i32* noalias %sum) {
19 for.cond: ; preds = %for.inc, %entry
20 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
21 %exitcond = icmp ne i32 %i.0, 1024
22 br i1 %exitcond, label %for.body, label %for.end
24 for.body: ; preds = %for.cond
25 %tmp = load i32, i32* %sum, align 4
26 %tmp1 = mul i32 %tmp, 5
27 %mul = add i32 %tmp1, 25
28 store i32 %mul, i32* %sum, align 4
31 for.inc: ; preds = %for.body
32 %inc = add nsw i32 %i.0, 1
35 for.end: ; preds = %for.cond