[llvm-commits] [llvm] r166752 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp
Hal Finkel
hfinkel at anl.gov
Thu Oct 25 21:28:07 PDT 2012
Author: hfinkel
Date: Thu Oct 25 23:28:06 2012
New Revision: 166752
URL: http://llvm.org/viewvc/llvm-project?rev=166752&view=rev
Log:
Use VTTI->getNumberOfParts in BBVectorize.
This change reflects VTTI refactoring; no functionality change intended.
Modified:
llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp?rev=166752&r1=166751&r2=166752&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp Thu Oct 25 23:28:06 2012
@@ -819,12 +819,13 @@
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 @@
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;
More information about the llvm-commits
mailing list