[llvm-commits] [llvm] r166738 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Hal Finkel hfinkel at anl.gov
Thu Oct 25 16:47:16 PDT 2012


Author: hfinkel
Date: Thu Oct 25 18:47:16 2012
New Revision: 166738

URL: http://llvm.org/viewvc/llvm-project?rev=166738&view=rev
Log:
BBVectorize, when using VTTI, should not form types that will be split.

This is needed so that perl's SHA can be compiled (otherwise
BBVectorize takes far too long to find its fixed point).

I'll try to come up with a reduced test case.

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=166738&r1=166737&r2=166738&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp Thu Oct 25 18:47:16 2012
@@ -817,6 +817,15 @@
                                                  IAddressSpace);
           if (VCost > ICost + JCost)
             return false;
+
+          // FIXME: 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)
+            return false;
+
           CostSavings = ICost + JCost - VCost;
         }
       } else {
@@ -831,6 +840,16 @@
 
       if (VCost > ICost + JCost)
         return false;
+
+      // FIXME: 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)
+        return false;
+
       CostSavings = ICost + JCost - VCost;
     }
 





More information about the llvm-commits mailing list