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