brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 2fd71c2 Raw
59 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s | FileCheck %s2;3; Sum is added twice in the statement. Hence no reduction.4; CHECK: Reduction Type: NONE5;6;    void f(int *restrict sum, int *restrict A) {7;      for (int i = 0; i < 1024; i++)8;        *sum = (A[i + 3] * (i - 14)) + ((A[i] + *sum + A[0]) + A[1023]) +9;               (A[i + 2] * A[i - 1]) + *sum;10;    }11;12target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"13 14define void @f(i32* noalias %sum, i32* noalias %A) {15entry:16  br label %for.cond17 18for.cond:                                         ; preds = %for.inc, %entry19  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]20  %exitcond = icmp ne i32 %i.0, 102421  br i1 %exitcond, label %for.body, label %for.end22 23for.body:                                         ; preds = %for.cond24  %add = add nsw i32 %i.0, 325  %arrayidx = getelementptr inbounds i32, i32* %A, i32 %add26  %tmp = load i32, i32* %arrayidx, align 427  %sub = add nsw i32 %i.0, -1428  %mul = mul nsw i32 %tmp, %sub29  %arrayidx1 = getelementptr inbounds i32, i32* %A, i32 %i.030  %tmp1 = load i32, i32* %arrayidx1, align 431  %tmp2 = load i32, i32* %sum, align 432  %add2 = add nsw i32 %tmp1, %tmp233  %tmp3 = load i32, i32* %A, align 434  %add4 = add nsw i32 %add2, %tmp335  %arrayidx5 = getelementptr inbounds i32, i32* %A, i32 102336  %tmp4 = load i32, i32* %arrayidx5, align 437  %add6 = add nsw i32 %add4, %tmp438  %add7 = add nsw i32 %mul, %add639  %add8 = add nsw i32 %i.0, 240  %arrayidx9 = getelementptr inbounds i32, i32* %A, i32 %add841  %tmp5 = load i32, i32* %arrayidx9, align 442  %sub10 = add nsw i32 %i.0, -143  %arrayidx11 = getelementptr inbounds i32, i32* %A, i32 %sub1044  %tmp6 = load i32, i32* %arrayidx11, align 445  %mul12 = mul nsw i32 %tmp5, %tmp646  %add13 = add nsw i32 %add7, %mul1247  %tmp7 = load i32, i32* %sum, align 448  %add14 = add nsw i32 %add13, %tmp749  store i32 %add14, i32* %sum, align 450  br label %for.inc51 52for.inc:                                          ; preds = %for.body53  %inc = add nsw i32 %i.0, 154  br label %for.cond55 56for.end:                                          ; preds = %for.cond57  ret void58}59