summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/BBVectorize/simple.ll
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-10-25 21:12:23 +0000
committerHal Finkel <hfinkel@anl.gov>2012-10-25 21:12:23 +0000
commitcbf9365f4c43b4f2ddc5b5a6568a5bc30359fc33 (patch)
tree482623f85898133d1eb20fd5d3630381a0a4761d /llvm/test/Transforms/BBVectorize/simple.ll
parent579042f71beed38bf0ac91f3f8f3aac7f7441de2 (diff)
downloadbcm5719-llvm-cbf9365f4c43b4f2ddc5b5a6568a5bc30359fc33.tar.gz
bcm5719-llvm-cbf9365f4c43b4f2ddc5b5a6568a5bc30359fc33.zip
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. llvm-svn: 166716
Diffstat (limited to 'llvm/test/Transforms/BBVectorize/simple.ll')
-rw-r--r--llvm/test/Transforms/BBVectorize/simple.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Transforms/BBVectorize/simple.ll b/llvm/test/Transforms/BBVectorize/simple.ll
index 88eb9c90f7e..702796b57d0 100644
--- a/llvm/test/Transforms/BBVectorize/simple.ll
+++ b/llvm/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>
}
OpenPOWER on IntegriCloud