From dfed941eec93d257ce0671dec032bb67074acdf6 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Fri, 13 Apr 2018 20:16:32 +0000 Subject: [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 --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 51be86ff337..fa736610cf5 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; } -- cgit v1.2.3