Skip to content

Commit

Permalink
Don't assert on invalid loop vectorization hint.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190450 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
eefriedman committed Sep 10, 2013
1 parent add560e commit 8e5eb2b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,15 +864,18 @@ struct LoopVectorizeHints {
unsigned Val = C->getZExtValue();

if (Hint == "width") {
assert(isPowerOf2_32(Val) && Val <= MaxVectorWidth &&
"Invalid width metadata");
Width = Val;
if (isPowerOf2_32(Val) && Val <= MaxVectorWidth)
Width = Val;
else
DEBUG(dbgs() << "LV: ignoring invalid width hint metadata");
} else if (Hint == "unroll") {
assert(isPowerOf2_32(Val) && Val <= MaxUnrollFactor &&
"Invalid unroll metadata");
Unroll = Val;
} else
if (isPowerOf2_32(Val) && Val <= MaxUnrollFactor)
Unroll = Val;
else
DEBUG(dbgs() << "LV: ignoring invalid unroll hint metadata");
} else {
DEBUG(dbgs() << "LV: ignoring unknown hint " << Hint);
}
}
};

Expand Down

0 comments on commit 8e5eb2b

Please sign in to comment.