diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-22 14:18:17 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-22 14:18:17 +0000 |
commit | 3c05cad03e70392e26f48095b87a6ba5256f8256 (patch) | |
tree | 82bcf0fd9ec8f36af6cbe9c0d1c52bf20667c46b /llvm/lib/Transforms/Vectorize | |
parent | 7773fc478d326bd8362024de698e84d1dc6082bd (diff) | |
download | bcm5719-llvm-3c05cad03e70392e26f48095b87a6ba5256f8256.tar.gz bcm5719-llvm-3c05cad03e70392e26f48095b87a6ba5256f8256.zip |
LoopVectorizationCostModel::selectInterleaveCount - assert we have a non-zero loop cost. NFCI.
The input LoopCost value can be zero, but if so it should be recalculated with the current VF. After that it should always be non-zero.
llvm-svn: 361387
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index ce03b854ffd..ad3030cedc3 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -5001,6 +5001,8 @@ unsigned LoopVectorizationCostModel::selectInterleaveCount(bool OptForSize, if (LoopCost == 0) LoopCost = expectedCost(VF).first; + assert(LoopCost && "Non-zero loop cost expected"); + // Clamp the calculated IC to be between the 1 and the max interleave count // that the target allows. if (IC > MaxInterleaveCount) |