brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 528c4b3 Raw
47 lines · plain
1; RUN: opt < %s -passes=loop-vectorize,instcombine -force-vector-width=4 -force-vector-interleave=1 -S | FileCheck %s2 3target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"4 5; CHECK-LABEL: @foo(6define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i32 %N) {7entry:8  %cmp.4 = icmp sgt i32 %N, 09  br i1 %cmp.4, label %for.body.preheader, label %for.end10 11for.body.preheader:                               ; preds = %entry12  br label %for.body13 14for.body:                                         ; preds = %for.body.preheader, %for.body15  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]16 17; Check that we don't lose !nontemporal hint when attempting vectorizing of loads.18; CHECK: load {{.*}} align 4, !nontemporal !019  %arrayidx = getelementptr inbounds float, ptr %b, i64 %indvars.iv20  %0 = load float, ptr %arrayidx, align 4, !nontemporal !021 22; Check that we don't introduce !nontemporal hint when the original scalar loads didn't have it.23; CHECK: load {{.*}} align 4{{$}}24  %arrayidx2 = getelementptr inbounds float, ptr %c, i64 %indvars.iv25  %1 = load float, ptr %arrayidx2, align 426  %add = fadd float %0, %127 28; Check that we don't lose !nontemporal hint when attempting vectorizing of stores.29; CHECK: store {{.*}} align 4, !nontemporal !030  %arrayidx4 = getelementptr inbounds float, ptr %a, i64 %indvars.iv31  store float %add, ptr %arrayidx4, align 4, !nontemporal !032 33  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 134  %lftr.wideiv = trunc i64 %indvars.iv.next to i3235  %exitcond = icmp eq i32 %lftr.wideiv, %N36  br i1 %exitcond, label %for.end.loopexit, label %for.body37 38for.end.loopexit:                                 ; preds = %for.body39  br label %for.end40 41for.end:                                          ; preds = %for.end.loopexit, %entry42; CHECK: ret void43  ret void44}45 46!0 = !{i32 1}47