brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · c8686d9 Raw
39 lines · plain
1; REQUIRES: asserts2; 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 %s5 6; Check costs for branches inside a vectorized loop around predicated7; blocks. Each such branch will be guarded with an extractelement from the8; vector compare plus a test under mask instruction. This cost is modelled on9; the extractelement of i1.10 11define void @fun(ptr %arr, i64 %trip.count) {12entry:13  br label %for.body14 15for.body:16  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]17  %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv18  %l = load i32, ptr %arrayidx, align 419  %cmp55 = icmp sgt i32 %l, 020  br i1 %cmp55, label %if.then, label %for.inc21 22if.then:23  %sub = sub nsw i32 0, %l24  store i32 %sub, ptr %arrayidx, align 425  br label %for.inc26 27for.inc:28  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 129  %exitcond = icmp eq i64 %indvars.iv.next, %trip.count30  br i1 %exitcond, label %for.end.loopexit, label %for.body31 32for.end.loopexit:33  ret void34 35; CHECK: LV: Found an estimated cost of 7 for VF 2 For instruction:   br i1 %cmp55, label %if.then, label %for.inc36; CHECK: LV: Found an estimated cost of 0 for VF 2 For instruction:   br label %for.inc37; CHECK: LV: Found an estimated cost of 1 for VF 2 For instruction:   br i1 %exitcond, label %for.end.loopexit, label %for.body38}39