diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /test/Transforms/SLPVectorizer/AArch64/commute.ll | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'test/Transforms/SLPVectorizer/AArch64/commute.ll')
-rw-r--r-- | test/Transforms/SLPVectorizer/AArch64/commute.ll | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/test/Transforms/SLPVectorizer/AArch64/commute.ll b/test/Transforms/SLPVectorizer/AArch64/commute.ll new file mode 100644 index 0000000..4ee91a5 --- /dev/null +++ b/test/Transforms/SLPVectorizer/AArch64/commute.ll @@ -0,0 +1,75 @@ +; RUN: opt -S -slp-vectorizer %s | FileCheck %s +target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128" +target triple = "aarch64--linux-gnu" + +%structA = type { [2 x float] } + +define void @test1(%structA* nocapture readonly %J, i32 %xmin, i32 %ymin) { +; CHECK-LABEL: test1 +; CHECK: %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 +; CHECK: %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 +; CHECK: %3 = bitcast float* %arrayidx4 to <2 x float>* +; CHECK: %4 = load <2 x float>* %3, align 4 +; CHECK: %5 = fsub fast <2 x float> %2, %4 +; CHECK: %6 = fmul fast <2 x float> %5, %5 +; CHECK: %7 = extractelement <2 x float> %6, i32 0 +; CHECK: %8 = extractelement <2 x float> %6, i32 1 +; CHECK: %add = fadd fast float %7, %8 +; CHECK: %cmp = fcmp oeq float %add, 0.000000e+00 + +entry: + br label %for.body3.lr.ph + +for.body3.lr.ph: + %conv5 = sitofp i32 %ymin to float + %conv = sitofp i32 %xmin to float + %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 + %0 = load float* %arrayidx4, align 4 + %sub = fsub fast float %conv, %0 + %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 + %1 = load float* %arrayidx9, align 4 + %sub10 = fsub fast float %conv5, %1 + %mul11 = fmul fast float %sub, %sub + %mul12 = fmul fast float %sub10, %sub10 + %add = fadd fast float %mul11, %mul12 + %cmp = fcmp oeq float %add, 0.000000e+00 + br i1 %cmp, label %for.body3.lr.ph, label %for.end27 + +for.end27: + ret void +} + +define void @test2(%structA* nocapture readonly %J, i32 %xmin, i32 %ymin) { +; CHECK-LABEL: test2 +; CHECK: %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 +; CHECK: %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 +; CHECK: %3 = bitcast float* %arrayidx4 to <2 x float>* +; CHECK: %4 = load <2 x float>* %3, align 4 +; CHECK: %5 = fsub fast <2 x float> %2, %4 +; CHECK: %6 = fmul fast <2 x float> %5, %5 +; CHECK: %7 = extractelement <2 x float> %6, i32 0 +; CHECK: %8 = extractelement <2 x float> %6, i32 1 +; CHECK: %add = fadd fast float %8, %7 +; CHECK: %cmp = fcmp oeq float %add, 0.000000e+00 + +entry: + br label %for.body3.lr.ph + +for.body3.lr.ph: + %conv5 = sitofp i32 %ymin to float + %conv = sitofp i32 %xmin to float + %arrayidx4 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 0 + %0 = load float* %arrayidx4, align 4 + %sub = fsub fast float %conv, %0 + %arrayidx9 = getelementptr inbounds %structA* %J, i64 0, i32 0, i64 1 + %1 = load float* %arrayidx9, align 4 + %sub10 = fsub fast float %conv5, %1 + %mul11 = fmul fast float %sub, %sub + %mul12 = fmul fast float %sub10, %sub10 + %add = fadd fast float %mul12, %mul11 ;;;<---- Operands commuted!! + %cmp = fcmp oeq float %add, 0.000000e+00 + br i1 %cmp, label %for.body3.lr.ph, label %for.end27 + +for.end27: + ret void +} |