summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
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
commit20a49d6f2cf12f39c911d431d79585c7681d28b2 (patch)
tree4e9cecca00ae7a93561c16329c6e58f0029d8aca /llvm/lib/Transforms/Vectorize/BBVectorize.cpp
parent9d1ee1175de34aca8fce8cdca268e7a3287327ed (diff)
downloadbcm5719-llvm-20a49d6f2cf12f39c911d431d79585c7681d28b2.tar.gz
bcm5719-llvm-20a49d6f2cf12f39c911d431d79585c7681d28b2.zip
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. llvm-svn: 166738
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/BBVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/BBVectorize.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
index 61e8d735e41..95b78322caa 100644
--- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud