mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
3f340be0fb
llvm-svn: 245632
48 lines
2.0 KiB
LLVM
48 lines
2.0 KiB
LLVM
; RUN: opt < %s -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -instcombine -S | FileCheck %s
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
|
target triple = "arm64-apple-ios5.0.0"
|
|
|
|
; CHECK-LABEL: @foo(
|
|
define void @foo(float* noalias %a, float* noalias %b, float* noalias %c, i32 %N) {
|
|
entry:
|
|
%cmp.4 = icmp sgt i32 %N, 0
|
|
br i1 %cmp.4, label %for.body.preheader, label %for.end
|
|
|
|
for.body.preheader: ; preds = %entry
|
|
br label %for.body
|
|
|
|
for.body: ; preds = %for.body.preheader, %for.body
|
|
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
|
|
|
|
; Check that we don't lose !nontemporal hint when vectorizing loads.
|
|
; CHECK: %wide.load{{[0-9]*}} = load <4 x float>, <4 x float>* %{{[0-9]+}}, align 4, !nontemporal !0
|
|
%arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv
|
|
%0 = load float, float* %arrayidx, align 4, !nontemporal !0
|
|
|
|
; Check that we don't introduce !nontemporal hint when the original scalar loads didn't have it.
|
|
; CHECK: %wide.load{{[0-9]+}} = load <4 x float>, <4 x float>* %{{[0-9]+}}, align 4{{$}}
|
|
%arrayidx2 = getelementptr inbounds float, float* %c, i64 %indvars.iv
|
|
%1 = load float, float* %arrayidx2, align 4
|
|
%add = fadd float %0, %1
|
|
|
|
; Check that we don't lose !nontemporal hint when vectorizing stores.
|
|
; CHECK: store <4 x float> %{{[0-9]+}}, <4 x float>* %{{[0-9]+}}, align 4, !nontemporal !0
|
|
%arrayidx4 = getelementptr inbounds float, float* %a, i64 %indvars.iv
|
|
store float %add, float* %arrayidx4, align 4, !nontemporal !0
|
|
|
|
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
|
|
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
|
|
%exitcond = icmp eq i32 %lftr.wideiv, %N
|
|
br i1 %exitcond, label %for.end.loopexit, label %for.body
|
|
|
|
for.end.loopexit: ; preds = %for.body
|
|
br label %for.end
|
|
|
|
for.end: ; preds = %for.end.loopexit, %entry
|
|
; CHECK: ret void
|
|
ret void
|
|
}
|
|
|
|
!0 = !{i32 1}
|