Skip to content

Commit

Permalink
[WarnMissedTransforms] Set default to 1.
Browse files Browse the repository at this point in the history
Summary:
Set default value for retrieved attributes to 1, since the check is against 1.
Eliminates the warning noise generated when the attributes are not present.

Reviewers: sanjoy

Subscribers: jlebar, llvm-commits

Differential Revision: https://reviews.llvm.org/D57253

llvm-svn: 352238
  • Loading branch information
alinas committed Jan 25, 2019
1 parent 05a6064 commit 890a8e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
Expand Up @@ -51,15 +51,15 @@ static void warnAboutLeftoverTransformations(Loop *L,
Optional<int> InterleaveCount =
getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count");

if (VectorizeWidth.getValueOr(0) != 1)
if (VectorizeWidth.getValueOr(1) != 1)
ORE->emit(
DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
"FailedRequestedVectorization",
L->getStartLoc(), L->getHeader())
<< "loop not vectorized: the optimizer was unable to perform the "
"requested transformation; the transformation might be disabled "
"or specified as part of an unsupported transformation ordering");
else if (InterleaveCount.getValueOr(0) != 1)
else if (InterleaveCount.getValueOr(1) != 1)
ORE->emit(
DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
"FailedRequestedInterleaving",
Expand Down

0 comments on commit 890a8e5

Please sign in to comment.