diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-04-13 20:16:32 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-04-13 20:16:32 +0000 |
commit | dfed941eec93d257ce0671dec032bb67074acdf6 (patch) | |
tree | 0a677852c734cb9ba1ff6c414597855100960ffd /llvm/lib/Target | |
parent | 0f035ebed29f3ab5392164e75472b8d46e022d22 (diff) | |
download | bcm5719-llvm-dfed941eec93d257ce0671dec032bb67074acdf6.tar.gz bcm5719-llvm-dfed941eec93d257ce0671dec032bb67074acdf6.zip |
[LV] Introduce TTI::getMinimumVF
The function getMinimumVF(ElemWidth) will return the minimum VF for
a vector with elements of size ElemWidth bits. This value will only
apply to targets for which TTI::shouldMaximizeVectorBandwidth returns
true. The value of 0 indicates that there is no minimum VF.
Differential Revision: https://reviews.llvm.org/D45271
llvm-svn: 330062
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp index d5401a277b6..764e8b8b788 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.cpp @@ -76,6 +76,10 @@ unsigned HexagonTTIImpl::getMinVectorRegisterBitWidth() const { return getST()->useHVXOps() ? getST()->getVectorLength()*8 : 0; } +unsigned HexagonTTIImpl::getMinimumVF(unsigned ElemWidth) const { + return (8 * getST()->getVectorLength()) / ElemWidth; +} + unsigned HexagonTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment, unsigned AddressSpace, const Instruction *I) { if (Opcode == Instruction::Load && Src->isVectorTy()) { diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h index 02324d7efc4..61ffdf64f9f 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h @@ -74,6 +74,7 @@ public: unsigned getRegisterBitWidth(bool Vector) const; unsigned getMinVectorRegisterBitWidth() const; bool shouldMaximizeVectorBandwidth(bool OptSize) const { return true; } + unsigned getMinimumVF(unsigned ElemWidth) const; bool supportsEfficientVectorElementLoadStore() { return false; |