diff options
| author | Jim Grosbach <grosbach@apple.com> | 2014-03-27 00:04:11 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2014-03-27 00:04:11 +0000 |
| commit | 72fbde84b819cdeba99cd86e83525743f46e6234 (patch) | |
| tree | a8e38a63d39e1328bfdecbbb371c3a98200c9133 /llvm/test | |
| parent | ef3e831965c9451d264a9c4676d03e428018f1e7 (diff) | |
| download | bcm5719-llvm-72fbde84b819cdeba99cd86e83525743f46e6234.tar.gz bcm5719-llvm-72fbde84b819cdeba99cd86e83525743f46e6234.zip | |
X86: Correct vectorization cost model for v8f32->v8i8.
Fix the cost model to reflect the reality of our codegen.
rdar://16370633
llvm-svn: 204880
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll b/llvm/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll new file mode 100644 index 00000000000..6bc3b4cf3f2 --- /dev/null +++ b/llvm/test/Transforms/LoopVectorize/X86/fp_to_sint8-cost-model.ll @@ -0,0 +1,24 @@ +; RUN: opt < %s -loop-vectorize -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx -S -debug-only=loop-vectorize 2>&1 | FileCheck %s + +target 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" +target triple = "x86_64-apple-macosx10.8.0" + + +; CHECK: cost of 7 for VF 8 For instruction: %conv = fptosi float %tmp to i8 +define void @float_to_sint8_cost(i8* noalias nocapture %a, float* noalias nocapture readonly %b) nounwind { +entry: + br label %for.body +for.body: + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] + %arrayidx = getelementptr inbounds float* %b, i64 %indvars.iv + %tmp = load float* %arrayidx, align 4 + %conv = fptosi float %tmp to i8 + %arrayidx2 = getelementptr inbounds i8* %a, i64 %indvars.iv + store i8 %conv, i8* %arrayidx2, align 4 + %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 + %exitcond = icmp eq i64 %indvars.iv.next, 256 + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} |

