[LoopVectorizer] Fix bailing-out condition for OptForSize case.

With option OptForSize enabled, the Loop Vectorizer is not supposed to
create tail loop. The condition checking that was invalid and was not
matching to the comment above.

Patch by Marianne Mailhot-Sarrasin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240556 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael Zolotukhin
2015-06-24 17:26:24 +00:00
parent 9a5f962059
commit baf8f6a261
2 changed files with 37 additions and 4 deletions

View File

@@ -4642,10 +4642,9 @@ LoopVectorizationCostModel::selectVectorizationFactor(bool OptForSize) {
if (VF == 0)
VF = MaxVectorSize;
// If the trip count that we found modulo the vectorization factor is not
// zero then we require a tail.
if (VF < 2) {
else {
// If the trip count that we found modulo the vectorization factor is not
// zero then we require a tail.
emitAnalysis(VectorizationReport() <<
"cannot optimize for size and vectorize at the "
"same time. Enable vectorization of this loop "