BBVectorize: Add a additional comment about the cost computation
authorHal Finkel <hfinkel@anl.gov>
Sat, 26 Jan 2013 16:49:04 +0000 (16:49 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 26 Jan 2013 16:49:04 +0000 (16:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173580 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/BBVectorize.cpp

index 411d7f6ba3387e97c08921be76ac93a44cab2427..4bd11c6844608a053cb6e9087ca68ae0c5d61672 100644 (file)
@@ -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)