[llvm] e2f1c4c - [LV] Turn check for unexpected VF into assertion (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 31 05:20:29 PST 2021


Author: Florian Hahn
Date: 2021-12-31T13:19:03Z
New Revision: e2f1c4c7066b34ad171d91879263cfa32bc6c55c

URL: https://github.com/llvm/llvm-project/commit/e2f1c4c7066b34ad171d91879263cfa32bc6c55c
DIFF: https://github.com/llvm/llvm-project/commit/e2f1c4c7066b34ad171d91879263cfa32bc6c55c.diff

LOG: [LV] Turn check for unexpected VF into assertion (NFC).

VF should always be non-zero in widenIntOrFpInduction. Turn check into
assertion.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 5635b1596bace..828f1f3e107b3 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2499,6 +2499,7 @@ void InnerLoopVectorizer::widenIntOrFpInduction(PHINode *IV,
   assert((IV->getType()->isIntegerTy() || IV != OldInduction) &&
          "Primary induction variable must have an integer type");
   assert(IV->getType() == ID.getStartValue()->getType() && "Types must match");
+  assert(!State.VF.isZero() && "VF must be non-zero");
 
   // The value from the original loop to which we are mapping the new induction
   // variable.
@@ -2573,7 +2574,7 @@ void InnerLoopVectorizer::widenIntOrFpInduction(PHINode *IV,
 
   // Now do the actual transformations, and start with creating the step value.
   Value *Step = CreateStepValue(ID.getStep());
-  if (State.VF.isZero() || State.VF.isScalar()) {
+  if (State.VF.isScalar()) {
     Value *ScalarIV = CreateScalarIV(Step);
     CreateSplatIV(ScalarIV, Step);
     return;


        


More information about the llvm-commits mailing list