1 ; RUN: opt -Oz -S -enable-new-pm=0 < %s | FileCheck %s
2 ; RUN: opt -passes='default<Oz>' -S < %s | FileCheck %s
4 ; Forcing vectorization should allow for more aggressive loop-rotation with
5 ; -Oz, because LV requires rotated loops. Make sure the loop in @foo is
8 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
9 target triple = "arm64-apple-ios5.0.0"
11 define void @foo(float* noalias nocapture %ptrA, float* noalias nocapture readonly %ptrB, i64 %size) {
13 ; CHECK: fmul <4 x float>
18 for.cond: ; preds = %for.body, %entry
19 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
20 %exitcond = icmp eq i64 %indvars.iv, %size
21 br i1 %exitcond, label %for.cond.cleanup, label %for.body
23 for.body: ; preds = %for.cond
24 %arrayidx = getelementptr inbounds float, float* %ptrB, i64 %indvars.iv
25 %0 = load float, float* %arrayidx, align 4
26 %arrayidx2 = getelementptr inbounds float, float* %ptrA, i64 %indvars.iv
27 %1 = load float, float* %arrayidx2, align 4
28 %mul3 = fmul float %0, %1
29 store float %mul3, float* %arrayidx2, align 4
30 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
31 br label %for.cond, !llvm.loop !0
33 for.cond.cleanup: ; preds = %for.cond
37 !0 = distinct !{!0, !1}
38 !1 = !{!"llvm.loop.vectorize.enable", i1 true}