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/Transforms | |
parent | 0f035ebed29f3ab5392164e75472b8d46e022d22 (diff) | |
download | llvm-dfed941eec93d257ce0671dec032bb67074acdf6.zip llvm-dfed941eec93d257ce0671dec032bb67074acdf6.tar.gz llvm-dfed941eec93d257ce0671dec032bb67074acdf6.tar.bz2 |
[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/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 51be86f..fa73661 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -6143,6 +6143,13 @@ LoopVectorizationCostModel::computeFeasibleMaxVF(bool OptForSize, break; } } + if (unsigned MinVF = TTI.getMinimumVF(SmallestType)) { + if (MaxVF < MinVF) { + DEBUG(dbgs() << "LV: Overriding calculated MaxVF(" << MaxVF + << ") with target's minimum: " << MinVF << '\n'); + MaxVF = MinVF; + } + } } return MaxVF; } |