aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-10-25 23:47:16 +0000
committerHal Finkel <hfinkel@anl.gov>2012-10-25 23:47:16 +0000
commit82149a9106f221aa6a7271977c236b078e621f21 (patch)
tree6d3ae57ad11942c00f3fc9fbcc2cdf746c9cb1e2
parent12413ae7cb1d9689c6ef315de6d3d2ca640b8ed0 (diff)
downloadexternal_llvm-82149a9106f221aa6a7271977c236b078e621f21.zip
external_llvm-82149a9106f221aa6a7271977c236b078e621f21.tar.gz
external_llvm-82149a9106f221aa6a7271977c236b078e621f21.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166738 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Vectorize/BBVectorize.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp
index 61e8d73..95b7832 100644
--- a/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/lib/Transforms/Vectorize/BBVectorize.cpp
@@ -817,6 +817,15 @@ namespace {
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 @@ namespace {
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;
}