2 ; RUN: opt -mtriple=s390x-unknown-linux -mcpu=z13 -loop-vectorize \
3 ; RUN: -force-vector-width=2 -debug-only=loop-vectorize \
4 ; RUN: -disable-output < %s 2>&1 | FileCheck %s
6 ; Check costs for branches inside a vectorized loop around predicated
7 ; blocks. Each such branch will be guarded with an extractelement from the
8 ; vector compare plus a test under mask instruction. This cost is modelled on
9 ; the extractelement of i1.
11 define void @fun(i32* %arr, i64 %trip.count) {
16 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
17 %arrayidx = getelementptr inbounds i32, i32* %arr, i64 %indvars.iv
18 %l = load i32, i32* %arrayidx, align 4
19 %cmp55 = icmp sgt i32 %l, 0
20 br i1 %cmp55, label %if.then, label %for.inc
23 %sub = sub nsw i32 0, %l
24 store i32 %sub, i32* %arrayidx, align 4
28 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
29 %exitcond = icmp eq i64 %indvars.iv.next, %trip.count
30 br i1 %exitcond, label %for.end.loopexit, label %for.body
35 ; CHECK: LV: Found an estimated cost of 5 for VF 2 For instruction: br i1 %cmp55, label %if.then, label %for.inc
36 ; CHECK: LV: Found an estimated cost of 0 for VF 2 For instruction: br label %for.inc
37 ; CHECK: LV: Found an estimated cost of 0 for VF 2 For instruction: br i1 %exitcond, label %for.end.loopexit, label %for.body