diff options
author | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2013-01-29 21:42:08 +0000 |
---|---|---|
committer | Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi> | 2013-01-29 21:42:08 +0000 |
commit | d8550495768d87f9b0d3219c40a5b15518ccacc8 (patch) | |
tree | 1dcec15f6640c03504e9282cb091efbeb9249d2e /test | |
parent | 485da648484e443f38c8ddbe5cb8ace07e2166e7 (diff) | |
download | external_llvm-d8550495768d87f9b0d3219c40a5b15518ccacc8.zip external_llvm-d8550495768d87f9b0d3219c40a5b15518ccacc8.tar.gz external_llvm-d8550495768d87f9b0d3219c40a5b15518ccacc8.tar.bz2 |
LoopVectorize: convert TinyTripCountVectorThreshold constant
to a command line switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/LoopVectorize/min-trip-count-switch.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Transforms/LoopVectorize/min-trip-count-switch.ll b/test/Transforms/LoopVectorize/min-trip-count-switch.ll new file mode 100644 index 0000000..186fba8 --- /dev/null +++ b/test/Transforms/LoopVectorize/min-trip-count-switch.ll @@ -0,0 +1,28 @@ +; RUN: opt < %s -loop-vectorize -force-vector-unroll=1 -vectorizer-min-trip-count=1 -force-vector-width=4 -dce -instcombine -S | 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-unknown-linux-gnu" + +; CHECK: <4 x float> +define void @trivial_loop(float* nocapture %a) nounwind uwtable optsize { +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] + %arrayidx = getelementptr inbounds float* %a, i64 %indvars.iv + %0 = load float* %arrayidx, align 4, !tbaa !0 + %add = fadd float %0, 1.000000e+00 + store float %add, float* %arrayidx, align 4, !tbaa !0 + %indvars.iv.next = add i64 %indvars.iv, 1 + %lftr.wideiv = trunc i64 %indvars.iv.next to i32 + %exitcond = icmp eq i32 %lftr.wideiv, 8 + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body + ret void +} + +!0 = metadata !{metadata !"float", metadata !1} +!1 = metadata !{metadata !"omnipotent char", metadata !2} +!2 = metadata !{metadata !"Simple C/C++ TBAA"} |