summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-01-26 16:49:04 +0000
committerHal Finkel <hfinkel@anl.gov>2013-01-26 16:49:04 +0000
commitec5c3c2bd37828e9fbd913f5ac7b7f75711ddd59 (patch)
tree596f73254fc5c24deb6ab2a9237a6cd592e838e9 /lib/Transforms
parent7a8aba906416b6998347b52c3c08610fdc190638 (diff)
downloadllvm-ec5c3c2bd37828e9fbd913f5ac7b7f75711ddd59.tar.gz
llvm-ec5c3c2bd37828e9fbd913f5ac7b7f75711ddd59.tar.bz2
llvm-ec5c3c2bd37828e9fbd913f5ac7b7f75711ddd59.tar.xz
BBVectorize: Add a additional comment about the cost computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Vectorize/BBVectorize.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp
index 411d7f6ba3..4bd11c6844 100644
--- a/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/lib/Transforms/Vectorize/BBVectorize.cpp
@@ -994,6 +994,12 @@ namespace {
unsigned JCost = getInstrCost(J->getOpcode(), JT1, JT2);
Type *VT1 = getVecTypeForPair(IT1, JT1),
*VT2 = getVecTypeForPair(IT2, JT2);
+
+ // Note that this procedure is incorrect for insert and extract element
+ // instructions (because combining these often results in a shuffle),
+ // but this cost is ignored (because insert and extract element
+ // instructions are assigned a zero depth factor and are not really
+ // fused in general).
unsigned VCost = getInstrCost(I->getOpcode(), VT1, VT2);
if (VCost > ICost + JCost)