[llvm] c93f029 - [VPlan] Remove custom checks for EVL placement in verifier (NFCI).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 04:50:13 PDT 2024


Author: Florian Hahn
Date: 2024-04-22T12:49:49+01:00
New Revision: c93f02978c33897615a312a85c6149911544ad63

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

LOG: [VPlan] Remove custom checks for EVL placement in verifier (NFCI).

After e2a72fa583d9, def-use chains of EVL are modeled explicitly.
So there's no need for a custom check of its placement, as regular
def-use verification will catch mis-placements.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
index 5587302207acdb..7ebdb914fb852f 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -92,50 +92,7 @@ static bool verifyVPBasicBlock(const VPBasicBlock *VPBB,
   for (const VPRecipeBase &R : *VPBB)
     RecipeNumbering[&R] = Cnt++;
 
-  // Set of recipe types along with VPInstruction Opcodes of all EVL-related
-  // recipes that must appear at most once in the header block.
-  DenseSet<unsigned> EVLFound;
-  const VPRecipeBase *VPWidenMemRecipe = nullptr;
-  const VPlan *Plan = VPBB->getPlan();
-  bool IsHeader = Plan->getEntry()->getNumSuccessors() == 1 &&
-                  Plan->getVectorLoopRegion()->getEntry() == VPBB;
-  auto CheckEVLRecipiesInsts = [&](const VPRecipeBase *R) {
-    if (isa<VPEVLBasedIVPHIRecipe>(R)) {
-      if (!IsHeader) {
-        errs() << "EVL PHI recipe not in entry block!\n";
-        return false;
-      }
-      if (!EVLFound.insert(VPDef::VPEVLBasedIVPHISC).second) {
-        errs() << "EVL PHI recipe inserted more than once!\n";
-        return false;
-      }
-      return true;
-    }
-    if (const auto *RInst = dyn_cast<VPInstruction>(R);
-        RInst && RInst->getOpcode() == VPInstruction::ExplicitVectorLength) {
-      if (!IsHeader) {
-        errs() << "EVL instruction not in the header block!\n";
-        return false;
-      }
-      if (!EVLFound.insert(RInst->getOpcode() + VPDef::VPLastPHISC).second) {
-        errs() << "EVL instruction inserted more than once!\n";
-        return false;
-      }
-      if (VPWidenMemRecipe) {
-        errs() << "Use of EVL instruction by widen memory recipe before "
-                  "definition!\n";
-        return false;
-      }
-      return true;
-    }
-    if (isa<VPWidenMemoryRecipe>(R))
-      VPWidenMemRecipe = R;
-    return true;
-  };
-
   for (const VPRecipeBase &R : *VPBB) {
-    if (!CheckEVLRecipiesInsts(&R))
-      return false;
     for (const VPValue *V : R.definedValues()) {
       for (const VPUser *U : V->users()) {
         auto *UI = dyn_cast<VPRecipeBase>(U);


        


More information about the llvm-commits mailing list