1; RUN: opt < %s  -loop-vectorize -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx -S -debug-only=loop-vectorize 2>&1 | FileCheck %s
2; REQUIRES: asserts
3
4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5target triple = "x86_64-apple-macosx10.8.0"
6
7
8; CHECK: cost of 7 for VF 8 For instruction:   %conv = fptosi float %tmp to i8
9define void @float_to_sint8_cost(i8* noalias nocapture %a, float* noalias nocapture readonly %b) nounwind {
10entry:
11  br label %for.body
12for.body:
13  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
14  %arrayidx = getelementptr inbounds float, float* %b, i64 %indvars.iv
15  %tmp = load float, float* %arrayidx, align 4
16  %conv = fptosi float %tmp to i8
17  %arrayidx2 = getelementptr inbounds i8, i8* %a, i64 %indvars.iv
18  store i8 %conv, i8* %arrayidx2, align 4
19  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
20  %exitcond = icmp eq i64 %indvars.iv.next, 256
21  br i1 %exitcond, label %for.end, label %for.body
22
23for.end:
24  ret void
25}
26