diff options
| author | Wei Mi <wmi@google.com> | 2015-07-30 17:40:39 +0000 |
|---|---|---|
| committer | Wei Mi <wmi@google.com> | 2015-07-30 17:40:39 +0000 |
| commit | d6f7252e2ec08a66f5765b25ce70c4358392d6c1 (patch) | |
| tree | 77ae27a284339303a6571853856db6c459050801 /llvm/test | |
| parent | 443024b919d27d56bcc4792d8e3de6e824af6b1f (diff) | |
| download | bcm5719-llvm-d6f7252e2ec08a66f5765b25ce70c4358392d6c1.tar.gz bcm5719-llvm-d6f7252e2ec08a66f5765b25ce70c4358392d6c1.zip | |
[SLP vectorizer]: Choose the best consecutive candidate to pair with a store instruction.
The patch changes the SLPVectorizer::vectorizeStores to choose the immediate
succeeding or preceding candidate for a store instruction when it has multiple
consecutive candidates. In this way it has better chance to find more slp
vectorization opportunities.
Differential Revision: http://reviews.llvm.org/D10445
llvm-svn: 243666
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/SLPVectorizer/X86/pr23510.ll | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/pr23510.ll b/llvm/test/Transforms/SLPVectorizer/X86/pr23510.ll new file mode 100644 index 00000000000..efdb0ecd999 --- /dev/null +++ b/llvm/test/Transforms/SLPVectorizer/X86/pr23510.ll @@ -0,0 +1,38 @@ +; PR23510 +; RUN: opt < %s -basicaa -slp-vectorizer -S | FileCheck %s + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; CHECK-LABEL: @_Z3fooPml( +; CHECK: lshr <2 x i64> +; CHECK: lshr <2 x i64> + +@total = global i64 0, align 8 + +define void @_Z3fooPml(i64* nocapture %a, i64 %i) { +entry: + %tmp = load i64, i64* %a, align 8 + %shr = lshr i64 %tmp, 4 + store i64 %shr, i64* %a, align 8 + %arrayidx1 = getelementptr inbounds i64, i64* %a, i64 1 + %tmp1 = load i64, i64* %arrayidx1, align 8 + %shr2 = lshr i64 %tmp1, 4 + store i64 %shr2, i64* %arrayidx1, align 8 + %arrayidx3 = getelementptr inbounds i64, i64* %a, i64 %i + %tmp2 = load i64, i64* %arrayidx3, align 8 + %tmp3 = load i64, i64* @total, align 8 + %add = add i64 %tmp3, %tmp2 + store i64 %add, i64* @total, align 8 + %tmp4 = load i64, i64* %a, align 8 + %shr5 = lshr i64 %tmp4, 4 + store i64 %shr5, i64* %a, align 8 + %tmp5 = load i64, i64* %arrayidx1, align 8 + %shr7 = lshr i64 %tmp5, 4 + store i64 %shr7, i64* %arrayidx1, align 8 + %tmp6 = load i64, i64* %arrayidx3, align 8 + %tmp7 = load i64, i64* @total, align 8 + %add9 = add i64 %tmp7, %tmp6 + store i64 %add9, i64* @total, align 8 + ret void +} |

