summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-10-26 04:28:06 +0000
committerHal Finkel <hfinkel@anl.gov>2012-10-26 04:28:06 +0000
commitdc330f75b732b4ce1beace69ae7ed8e19d89bd9f (patch)
treecbb76d9ec2cb64c0220ceec04ed91dd149734e06 /lib
parent102a7c088c16b8bbed7cf56da9994fa52a9028c5 (diff)
downloadllvm-dc330f75b732b4ce1beace69ae7ed8e19d89bd9f.tar.gz
llvm-dc330f75b732b4ce1beace69ae7ed8e19d89bd9f.tar.bz2
llvm-dc330f75b732b4ce1beace69ae7ed8e19d89bd9f.tar.xz
Use VTTI->getNumberOfParts in BBVectorize.
This change reflects VTTI refactoring; no functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Vectorize/BBVectorize.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp
index 469ee176dd..87cde5f6db 100644
--- a/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/lib/Transforms/Vectorize/BBVectorize.cpp
@@ -819,12 +819,13 @@ namespace {
if (VCost > ICost + JCost)
return false;
- // FIXME: We don't want to fuse to a type that will be split, even
+ // We don't want to fuse to a type that will be split, even
// if the two input types will also be split and there is no other
- // associated cost. This check depends on the fact
- // that the current implementation of getMemoryOpCost returns only
- // the type-splitting cost.
- if (VCost > 1)
+ // associated cost.
+ unsigned VParts = VTTI->getNumberOfParts(VType);
+ if (VParts > 1)
+ return false;
+ else if (!VParts && VCost == ICost + JCost)
return false;
CostSavings = ICost + JCost - VCost;
@@ -842,13 +843,13 @@ namespace {
if (VCost > ICost + JCost)
return false;
- // FIXME: We don't want to fuse to a type that will be split, even
+ // We don't want to fuse to a type that will be split, even
// if the two input types will also be split and there is no other
- // associated cost. This check depends on the fact
- // that the current implementation of getMemoryOpCost returns only
- // the type-splitting cost (and does nothing else).
- unsigned VTypeCost = VTTI->getMemoryOpCost(I->getOpcode(), VT1, 0, 0);
- if (VTypeCost > 1)
+ // associated cost.
+ unsigned VParts = VTTI->getNumberOfParts(VT1);
+ if (VParts > 1)
+ return false;
+ else if (!VParts && VCost == ICost + JCost)
return false;
CostSavings = ICost + JCost - VCost;