Many tests were running extra passes after loop-vectorize, but they made no difference to the outcome. If tests don't require these extra passes, then we shouldn't run them because it increases the testing time.
47 lines
1.5 KiB
LLVM
47 lines
1.5 KiB
LLVM
; RUN: opt < %s -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -S | FileCheck %s
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
|
|
|
; CHECK-LABEL: @foo(
|
|
define void @foo(ptr noalias %a, ptr noalias %b, ptr 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:
|
|
br label %for.body
|
|
|
|
for.body:
|
|
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
|
|
|
|
; Check that we don't lose !nontemporal hint when attempting vectorizing of loads.
|
|
; CHECK: load {{.*}} align 4, !nontemporal !0
|
|
%arrayidx = getelementptr inbounds float, ptr %b, i64 %indvars.iv
|
|
%0 = load float, ptr %arrayidx, align 4, !nontemporal !0
|
|
|
|
; Check that we don't introduce !nontemporal hint when the original scalar loads didn't have it.
|
|
; CHECK: load {{.*}} align 4{{$}}
|
|
%arrayidx2 = getelementptr inbounds float, ptr %c, i64 %indvars.iv
|
|
%1 = load float, ptr %arrayidx2, align 4
|
|
%add = fadd float %0, %1
|
|
|
|
; Check that we don't lose !nontemporal hint when attempting vectorizing of stores.
|
|
; CHECK: store {{.*}} align 4, !nontemporal !0
|
|
%arrayidx4 = getelementptr inbounds float, ptr %a, i64 %indvars.iv
|
|
store float %add, ptr %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:
|
|
br label %for.end
|
|
|
|
for.end:
|
|
; CHECK: ret void
|
|
ret void
|
|
}
|
|
|
|
!0 = !{i32 1}
|