brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · f01b641 Raw
61 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;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(ptr %sums) {19entry:20  br label %for.cond21 22for.cond:                                         ; preds = %for.inc6, %entry23  %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]24  %exitcond1 = icmp ne i32 %i.0, 102425  br i1 %exitcond1, label %for.body, label %for.end826 27for.body:                                         ; preds = %for.cond28  br label %for.cond129 30for.cond1:                                        ; preds = %for.inc, %for.body31  %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]32  %exitcond = icmp ne i32 %j.0, 102433  br i1 %exitcond, label %for.body3, label %for.end34 35for.body3:                                        ; preds = %for.cond136  %arrayidx = getelementptr inbounds i32, ptr %sums, i32 %i.037  %tmp = load i32, ptr %arrayidx, align 438  %add = add nsw i32 %tmp, 539  store i32 %add, ptr %arrayidx, align 440  %add4 = add nsw i32 %i.0, 102441  %arrayidx5 = getelementptr inbounds i32, ptr %sums, i32 %add442  %tmp2 = load i32, ptr %arrayidx5, align 443  %mul = mul nsw i32 %tmp2, 544  store i32 %mul, ptr %arrayidx5, align 445  br label %for.inc46 47for.inc:                                          ; preds = %for.body348  %inc = add nsw i32 %j.0, 149  br label %for.cond150 51for.end:                                          ; preds = %for.cond152  br label %for.inc653 54for.inc6:                                         ; preds = %for.end55  %inc7 = add nsw i32 %i.0, 156  br label %for.cond57 58for.end8:                                         ; preds = %for.cond59  ret void60}61