[llvm-commits] [llvm] r173580 - BBVectorize: Add a additional comment about the cost computation
Hal Finkel
hfinkel at anl.gov
Sat Jan 26 08:49:05 PST 2013
Author: hfinkel
Date: Sat Jan 26 10:49:04 2013
New Revision: 173580
URL: http://llvm.org/viewvc/llvm-project?rev=173580&view=rev
Log:
BBVectorize: Add a additional comment about the cost computation
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=173580&r1=173579&r2=173580&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp Sat Jan 26 10:49:04 2013
@@ -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)
More information about the llvm-commits
mailing list