brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 618e4d3 Raw
53 lines · plain
1; RUN: opt -aa-pipeline=basic-aa %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<scops>' -polly-print-scops -polly-disable-multiplicative-reductions -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK: ReadAccess :=       [Reduction Type: +4; CHECK:     { Stmt_for_body[i0] -> MemRef_sum[0] };5; CHECK: MustWriteAccess :=  [Reduction Type: +6; CHECK:     { Stmt_for_body[i0] -> MemRef_sum[0] };7; CHECK: ReadAccess :=       [Reduction Type: NONE8; CHECK:     { Stmt_for_body[i0] -> MemRef_prod[0] };9; CHECK: MustWriteAccess :=  [Reduction Type: NONE10; CHECK:     { Stmt_for_body[i0] -> MemRef_prod[0] };11;12; int sum, prod;13;14; void f() {15;   int i;16;   for (int i = 0; i < 100; i++) {17;     sum += i * 3;18;     prod *= (i + 3);19;   }20; }21target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"22 23@sum = common global i32 0, align 424@prod = common global i32 0, align 425 26define void @f() #0 {27entry:28  br label %for.cond29 30for.cond:                                         ; preds = %for.inc, %entry31  %i1.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]32  %exitcond = icmp ne i32 %i1.0, 10033  br i1 %exitcond, label %for.body, label %for.end34 35for.body:                                         ; preds = %for.cond36  %mul = mul nsw i32 %i1.0, 337  %tmp = load i32, ptr @sum, align 438  %add = add nsw i32 %tmp, %mul39  store i32 %add, ptr @sum, align 440  %add2 = add nsw i32 %i1.0, 341  %tmp1 = load i32, ptr @prod, align 442  %mul3 = mul nsw i32 %tmp1, %add243  store i32 %mul3, ptr @prod, align 444  br label %for.inc45 46for.inc:                                          ; preds = %for.body47  %inc = add nsw i32 %i1.0, 148  br label %for.cond49 50for.end:                                          ; preds = %for.cond51  ret void52}53