summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-02-08 21:13:39 +0000
committerHal Finkel <hfinkel@anl.gov>2013-02-08 21:13:39 +0000
commitdd2721842df7d972e75b308a1af47de889e96f6f (patch)
treecfe9489c89de60863e014da867952834c1a838ce /llvm/lib/Transforms
parent995bc3f721d1610c3b663cc63de699682995daa6 (diff)
downloadbcm5719-llvm-dd2721842df7d972e75b308a1af47de889e96f6f.tar.gz
bcm5719-llvm-dd2721842df7d972e75b308a1af47de889e96f6f.zip
BBVectorize: Use TTI->getAddressComputationCost
This is a follow-up to the cost-model change in r174713 which splits the cost of a memory operation between the address computation and the actual memory access. In r174713, this cost is always added to the memory operation cost, and so BBVectorize will do the same. Currently, this new cost function is used only by ARM, and I don't have any ARM test cases for BBVectorize. Assistance in generating some good ARM test cases for BBVectorize would be greatly appreciated! llvm-svn: 174743
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/BBVectorize.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
index 9bf09ff122e..ec10b4207b5 100644
--- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp
@@ -972,6 +972,11 @@ namespace {
unsigned VCost = TTI->getMemoryOpCost(I->getOpcode(), VType,
BottomAlignment,
IAddressSpace);
+
+ ICost += TTI->getAddressComputationCost(aTypeI);
+ JCost += TTI->getAddressComputationCost(aTypeJ);
+ VCost += TTI->getAddressComputationCost(VType);
+
if (VCost > ICost + JCost)
return false;
OpenPOWER on IntegriCloud