brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 35cb9df Raw
68 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s3;4; CHECK: Reduction Type: NONE5;6; Check that we do not mark these accesses as reduction like.7; We do this for the case the loads are modelt with the same LLVM-IR value and8; for the case there are different LLVM-IR values.9;10;    void f(int *A) {11;      for (int i = 0; i < 1024; i++)12;        A[i] = A[i] + A[i];13;    }14;15target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"16 17define void @f_one_load_case(ptr %A) {18entry:19  br label %for.cond20 21for.cond:                                         ; preds = %for.inc, %entry22  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]23  %exitcond = icmp ne i32 %i.0, 102424  br i1 %exitcond, label %for.body, label %for.end25 26for.body:                                         ; preds = %for.cond27  %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.028  %tmp = load i32, ptr %arrayidx, align 429  %add = add nsw i32 %tmp, %tmp30  %arrayidx2 = getelementptr inbounds i32, ptr %A, i32 %i.031  store i32 %add, ptr %arrayidx2, align 432  br label %for.inc33 34for.inc:                                          ; preds = %for.body35  %inc = add nsw i32 %i.0, 136  br label %for.cond37 38for.end:                                          ; preds = %for.cond39  ret void40}41 42define void @f_two_loads_case(ptr %A) {43entry:44  br label %for.cond45 46for.cond:                                         ; preds = %for.inc, %entry47  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]48  %exitcond = icmp ne i32 %i.0, 102449  br i1 %exitcond, label %for.body, label %for.end50 51for.body:                                         ; preds = %for.cond52  %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.053  %tmp = load i32, ptr %arrayidx, align 454  %arrayidxCopy = getelementptr inbounds i32, ptr %A, i32 %i.055  %tmpCopy = load i32, ptr %arrayidxCopy, align 456  %add = add nsw i32 %tmp, %tmpCopy57  %arrayidx2 = getelementptr inbounds i32, ptr %A, i32 %i.058  store i32 %add, ptr %arrayidx2, align 459  br label %for.inc60 61for.inc:                                          ; preds = %for.body62  %inc = add nsw i32 %i.0, 163  br label %for.cond64 65for.end:                                          ; preds = %for.cond66  ret void67}68