diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-07-12 19:16:04 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-07-12 19:16:04 +0000 |
commit | 4a1c764264a8908aa041acf12f68cd8bcc2037b1 (patch) | |
tree | 096b496cf413d51391100de1ff9af0fa20a8345c /lib | |
parent | c0a11edba6ea46c782672ab3fb4e4ab3dc267a22 (diff) | |
download | external_llvm-4a1c764264a8908aa041acf12f68cd8bcc2037b1.zip external_llvm-4a1c764264a8908aa041acf12f68cd8bcc2037b1.tar.gz external_llvm-4a1c764264a8908aa041acf12f68cd8bcc2037b1.tar.bz2 |
ARM cost model: Add cost for gather/scather
Fixes a 35% degradation compared to unvectorized code in
MiBench/automotive-susan and an equally serious regression on a private
image processing benchmark.
radar://14351991
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMTargetTransformInfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMTargetTransformInfo.cpp b/lib/Target/ARM/ARMTargetTransformInfo.cpp index 79f56a4..5cc64de 100644 --- a/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -426,6 +426,15 @@ unsigned ARMTTI::getCmpSelInstrCost(unsigned Opcode, Type *ValTy, } unsigned ARMTTI::getAddressComputationCost(Type *Ty, bool IsComplex) const { + // Address computations in vectorized code with non-consecutive addresses will + // likely result in more instructions compared to scalar code where the + // computation can more often be merged into the index mode. The resulting + // extra micro-ops can significantly decrease throughput. + unsigned NumVectorInstToHideOverhead = 10; + + if (Ty->isVectorTy() && IsComplex) + return NumVectorInstToHideOverhead; + // In many cases the address computation is not merged into the instruction // addressing mode. return 1; |