Account for scalarization costs in BasicTTI::getMemoryOpCost for extending vector...
authorHal Finkel <hfinkel@anl.gov>
Thu, 3 Apr 2014 00:53:59 +0000 (00:53 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 3 Apr 2014 00:53:59 +0000 (00:53 +0000)
commitd68b03bcd2b734ab38c8a590456c4faa71deeb94
tree6437d41e174de794f9e3cb6a5d29360fa1bb23e2
parent14ae43449c7038afa8dced4f5cb054b243b67d76
Account for scalarization costs in BasicTTI::getMemoryOpCost for extending vector loads

When a vector type legalizes to a larger vector type, and the target does not
support the associated extending load (or truncating store), then legalization
will scalarize the load (or store) resulting in an associated scalarization
cost.  BasicTTI::getMemoryOpCost needs to account for this.

Between this, and r205487, PowerPC on the P7 with VSX enabled shows:

MultiSource/Benchmarks/PAQ8p/paq8p: 43% speedup
SingleSource/Benchmarks/BenchmarkGame/puzzle: 51% speedup
SingleSource/UnitTests/Vectorizer/gcc-loops 28% speedup

(some of these are new; some of these, such as PAQ8p, just reverse regressions
that VSX support would trigger)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205495 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BasicTargetTransformInfo.cpp
test/Analysis/CostModel/PowerPC/load_store.ll