diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-10-25 21:12:23 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-10-25 21:12:23 +0000 |
commit | 65309660fa61a837cc05323f69c618a7d8134d56 (patch) | |
tree | eee828ea648d4a984d4c67c45a43dcae48cf2301 /test | |
parent | 3ef9dfa6858e25015c3e36b2f1a0ba5ebdea80d2 (diff) | |
download | external_llvm-65309660fa61a837cc05323f69c618a7d8134d56.zip external_llvm-65309660fa61a837cc05323f69c618a7d8134d56.tar.gz external_llvm-65309660fa61a837cc05323f69c618a7d8134d56.tar.bz2 |
Begin incorporating target information into BBVectorize.
This is the first of several steps to incorporate information from the new
TargetTransformInfo infrastructure into BBVectorize. Two things are done here:
1. Target information is used to determine if it is profitable to fuse two
instructions. This means that the cost of the vector operation must not
be more expensive than the cost of the two original operations. Pairs that
are not profitable are no longer considered (because current cost information
is incomplete, for intrinsics for example, equal-cost pairs are still
considered).
2. The 'cost savings' computed for the profitability check are also used to
rank the DAGs that represent the potential vectorization plans. Specifically,
for nodes of non-trivial depth, the cost savings is used as the node
weight.
The next step will be to incorporate the shuffle costs into the DAG weighting;
this will give the edges of the DAG weights as well. Once that is done, when
target information is available, we should be able to dispense with the
depth heuristic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/BBVectorize/loop1.ll | 3 | ||||
-rw-r--r-- | test/Transforms/BBVectorize/simple.ll | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/BBVectorize/loop1.ll b/test/Transforms/BBVectorize/loop1.ll index bebc91a..a30af50 100644 --- a/test/Transforms/BBVectorize/loop1.ll +++ b/test/Transforms/BBVectorize/loop1.ll @@ -1,8 +1,11 @@ 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" ; RUN: opt < %s -bb-vectorize -bb-vectorize-req-chain-depth=3 -instcombine -gvn -S | FileCheck %s +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -bb-vectorize -bb-vectorize-req-chain-depth=3 -instcombine -gvn -S | FileCheck %s ; RUN: opt < %s -basicaa -loop-unroll -unroll-threshold=45 -unroll-allow-partial -bb-vectorize -bb-vectorize-req-chain-depth=3 -instcombine -gvn -S | FileCheck %s -check-prefix=CHECK-UNRL +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -basicaa -loop-unroll -unroll-threshold=45 -unroll-allow-partial -bb-vectorize -bb-vectorize-req-chain-depth=3 -instcombine -gvn -S | FileCheck %s -check-prefix=CHECK-UNRL ; The second check covers the use of alias analysis (with loop unrolling). +; Both checks are run with and without target information. define void @test1(double* noalias %out, double* noalias %in1, double* noalias %in2) nounwind uwtable { entry: diff --git a/test/Transforms/BBVectorize/simple.ll b/test/Transforms/BBVectorize/simple.ll index 88eb9c9..702796b 100644 --- a/test/Transforms/BBVectorize/simple.ll +++ b/test/Transforms/BBVectorize/simple.ll @@ -1,5 +1,6 @@ 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" ; RUN: opt < %s -bb-vectorize -bb-vectorize-req-chain-depth=3 -instcombine -gvn -S | FileCheck %s +; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -bb-vectorize -bb-vectorize-req-chain-depth=3 -instcombine -gvn -S | FileCheck %s -check-prefix=CHECK-TI ; Basic depth-3 chain define double @test1(double %A1, double %A2, double %B1, double %B2) { @@ -23,6 +24,9 @@ define double @test1(double %A1, double %A2, double %B1, double %B2) { ; CHECK: %R = fmul double %Z1.v.r1, %Z1.v.r2 ret double %R ; CHECK: ret double %R +; CHECK-TI: @test1 +; CHECK-TI: fsub <2 x double> +; CHECK-TI: ret double } ; Basic depth-3 chain (last pair permuted) @@ -146,6 +150,9 @@ define <8 x i8> @test6(<8 x i8> %A1, <8 x i8> %A2, <8 x i8> %B1, <8 x i8> %B2) { ; CHECK: %R = mul <8 x i8> %Q1.v.r1, %Q1.v.r2 ret <8 x i8> %R ; CHECK: ret <8 x i8> %R +; CHECK-TI: @test6 +; CHECK-TI-NOT: sub <16 x i8> +; CHECK-TI: ret <8 x i8> } |