[llvm] r361387 - LoopVectorizationCostModel::selectInterleaveCount - assert we have a non-zero loop cost. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 07:18:17 PDT 2019


Author: rksimon
Date: Wed May 22 07:18:17 2019
New Revision: 361387

URL: http://llvm.org/viewvc/llvm-project?rev=361387&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=361387&r1=361386&r2=361387&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed May 22 07:18:17 2019
@@ -5001,6 +5001,8 @@ unsigned LoopVectorizationCostModel::sel
   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)




More information about the llvm-commits mailing list