1; REQUIRES: asserts 2; RUN: opt -mtriple=s390x-unknown-linux -mcpu=z13 -passes=loop-vectorize \ 3; RUN: -force-vector-width=2 -debug-only=loop-vectorize \ 4; RUN: -disable-output < %s 2>&1 | FileCheck %s 5 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. 10 11define void @fun(ptr %arr, i64 %trip.count) { 12entry: 13 br label %for.body 14 15for.body: 16 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] 17 %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv 18 %l = load i32, ptr %arrayidx, align 4 19 %cmp55 = icmp sgt i32 %l, 0 20 br i1 %cmp55, label %if.then, label %for.inc 21 22if.then: 23 %sub = sub nsw i32 0, %l 24 store i32 %sub, ptr %arrayidx, align 4 25 br label %for.inc 26 27for.inc: 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 31 32for.end.loopexit: 33 ret void 34 35; CHECK: LV: Found an estimated cost of 7 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 1 for VF 2 For instruction: br i1 %exitcond, label %for.end.loopexit, label %for.body 38} 39