brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 0d01667 Raw
79 lines · plain
1; RUN: opt -aa-pipeline=basic-aa %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK: Stmt_for_body4; CHECK: Reduction Type: *5; CHECK: MemRef_sum6; CHECK: Reduction Type: *7; CHECK: MemRef_sum8; CHECK: Stmt_for_body39; CHECK: Reduction Type: NONE10; CHECK: MemRef_A11; CHECK: Reduction Type: +12; CHECK: MemRef_sum13; CHECK: Reduction Type: +14; CHECK: MemRef_sum15; CHECK: Stmt_for_end16; CHECK: Reduction Type: *17; CHECK: MemRef_sum18; CHECK: Reduction Type: *19; CHECK: MemRef_sum20;21; void f(int *restrict A, int *restrict sum) {22;   int i, j;23;   for (i = 0; i < 100; i++) {24;     *sum *= 7;25;     for (j = 0; j < 100; j++) {26;       *sum += A[i + j];27;     }28;     *sum *= 5;29;   }30; }31target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"32 33define void @f(ptr noalias %A, ptr noalias %sum) {34entry:35  br label %for.cond36 37for.cond:                                         ; preds = %for.inc6, %entry38  %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]39  %exitcond1 = icmp ne i32 %i.0, 10040  br i1 %exitcond1, label %for.body, label %for.end841 42for.body:                                         ; preds = %for.cond43  %tmp = load i32, ptr %sum, align 444  %mul = mul nsw i32 %tmp, 745  store i32 %mul, ptr %sum, align 446  br label %for.cond147 48for.cond1:                                        ; preds = %for.inc, %for.body49  %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]50  %exitcond = icmp ne i32 %j.0, 10051  br i1 %exitcond, label %for.body3, label %for.end52 53for.body3:                                        ; preds = %for.cond154  %add = add nsw i32 %i.0, %j.055  %arrayidx = getelementptr inbounds i32, ptr %A, i32 %add56  %tmp2 = load i32, ptr %arrayidx, align 457  %tmp3 = load i32, ptr %sum, align 458  %add4 = add nsw i32 %tmp3, %tmp259  store i32 %add4, ptr %sum, align 460  br label %for.inc61 62for.inc:                                          ; preds = %for.body363  %inc = add nsw i32 %j.0, 164  br label %for.cond165 66for.end:                                          ; preds = %for.cond167  %tmp4 = load i32, ptr %sum, align 468  %mul5 = mul nsw i32 %tmp4, 569  store i32 %mul5, ptr %sum, align 470  br label %for.inc671 72for.inc6:                                         ; preds = %for.end73  %inc7 = add nsw i32 %i.0, 174  br label %for.cond75 76for.end8:                                         ; preds = %for.cond77  ret void78}79