diff options
author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-07-12 19:16:07 +0000 |
---|---|---|
committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-07-12 19:16:07 +0000 |
commit | 6042a261b896459ffddee9235c471d435218686c (patch) | |
tree | d0e1ba71071bfbec0550a9db6046f3c4955fc6c7 /llvm/lib/Target/X86/X86TargetTransformInfo.cpp | |
parent | da2b3118651dec437f79fcb850ea50e8a36e653e (diff) | |
download | bcm5719-llvm-6042a261b896459ffddee9235c471d435218686c.tar.gz bcm5719-llvm-6042a261b896459ffddee9235c471d435218686c.zip |
X86 cost model: Add cost for vectorized gather/scather
radar://14351991
llvm-svn: 186189
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index 68e1a672436..3bbddadca88 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -100,6 +100,8 @@ public: unsigned Alignment, unsigned AddressSpace) const; + virtual unsigned getAddressComputationCost(Type *PtrTy, bool IsComplex) const; + /// @} }; @@ -598,3 +600,16 @@ unsigned X86TTI::getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, return Cost; } + +unsigned X86TTI::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; + + return TargetTransformInfo::getAddressComputationCost(Ty, IsComplex); +} |