From 3c05cad03e70392e26f48095b87a6ba5256f8256 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 22 May 2019 14:18:17 +0000 Subject: [PATCH] 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 --- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index ce03b854ffd5..ad3030cedc30 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)