brintos

brintos / llvm-project-archived public Read only

0
0
Text · 800 B · 7cc50bf Raw
28 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;5; void f(int* sum) {6;   for (int i = 0; i <= 100; i++)7;     sum += i * 3;8; }9target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"10 11define void @f(ptr %sum) {12entry:13  br label %for.cond14 15for.cond:                                         ; preds = %for.cond, %entr16  %i1.0 = phi i32 [ 0, %entry ], [ %inc, %for.cond ]17  %sum.reload = load i32, ptr %sum18  %mul = mul nsw i32 %i1.0, 319  %add = add nsw i32 %sum.reload, %mul20  %inc = add nsw i32 %i1.0, 121  store i32 %add, ptr %sum22  %cmp = icmp slt i32 %i1.0, 10023  br i1 %cmp, label %for.cond, label %for.end24 25for.end:                                          ; preds = %for.cond26  ret void27}28