diff options
author | Hal Finkel <hfinkel@anl.gov> | 2012-10-26 04:28:06 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2012-10-26 04:28:06 +0000 |
commit | 4863448dca975dc5d7bf4aa5c0425d150cc89c24 (patch) | |
tree | b55f20162f267e35bf6bf704d131006168bcfaab /llvm/lib/Transforms | |
parent | 9dd045f1784274c5341437dec16566ec6c124e13 (diff) | |
download | bcm5719-llvm-4863448dca975dc5d7bf4aa5c0425d150cc89c24.tar.gz bcm5719-llvm-4863448dca975dc5d7bf4aa5c0425d150cc89c24.zip |
Use VTTI->getNumberOfParts in BBVectorize.
This change reflects VTTI refactoring; no functionality change intended.
llvm-svn: 166752
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index 469ee176dd3..87cde5f6db3 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/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; |