diff options
author | Farhana Aleen <farhana.aleen@gmail.com> | 2018-05-01 21:41:12 +0000 |
---|---|---|
committer | Farhana Aleen <farhana.aleen@gmail.com> | 2018-05-01 21:41:12 +0000 |
commit | e2dfe8a8539bd457f517eaa3bb859c0f9ff21b31 (patch) | |
tree | 52ed315879d5b65321fa62e40f23b7c2350f4682 /llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | |
parent | 8d693602a1b990f0e44af9fd34c7e7ea3eca91b3 (diff) | |
download | bcm5719-llvm-e2dfe8a8539bd457f517eaa3bb859c0f9ff21b31.tar.gz bcm5719-llvm-e2dfe8a8539bd457f517eaa3bb859c0f9ff21b31.zip |
[AMDGPU] Support horizontal vectorization.
Author: FarhanaAleen
Reviewed By: rampitec, arsenm
Subscribers: llvm-commits, AMDGPU
Differential Revision: https://reviews.llvm.org/D46213
llvm-svn: 331313
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp index bf560a94b31..d9bee122ce7 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp @@ -468,6 +468,21 @@ unsigned AMDGPUTTIImpl::getCFInstrCost(unsigned Opcode) { } } +int AMDGPUTTIImpl::getArithmeticReductionCost(unsigned Opcode, Type *Ty, + bool IsPairwise) { + EVT OrigTy = TLI->getValueType(DL, Ty); + + // Computes cost on targets that have packed math instructions(which support + // 16-bit types only). + if (IsPairwise || + !ST->hasVOP3PInsts() || + OrigTy.getScalarSizeInBits() != 16) + return BaseT::getArithmeticReductionCost(Opcode, Ty, IsPairwise); + + std::pair<int, MVT> LT = TLI->getTypeLegalizationCost(DL, Ty); + return LT.first * getFullRateInstrCost(); +} + int AMDGPUTTIImpl::getVectorInstrCost(unsigned Opcode, Type *ValTy, unsigned Index) { switch (Opcode) { |