36 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] = sum[99-i] + i;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.inc, %entry16 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]17 %exitcond = icmp ne i32 %i.0, 10018 br i1 %exitcond, label %for.body, label %for.end19 20for.body: ; preds = %for.cond21 %sub = sub nsw i32 99, %i.022 %arrayidx = getelementptr inbounds i32, ptr %sum, i32 %sub23 %tmp = load i32, ptr %arrayidx, align 424 %add = add nsw i32 %tmp, %i.025 %arrayidx1 = getelementptr inbounds i32, ptr %sum, i32 %i.026 store i32 %add, ptr %arrayidx1, align 427 br label %for.inc28 29for.inc: ; preds = %for.body30 %inc = add nsw i32 %i.0, 131 br label %for.cond32 33for.end: ; preds = %for.cond34 ret void35}36