[llvm] eeca894 - [VPlan] Use switch over opcodes in verifier (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 12:10:59 PDT 2025


Author: Florian Hahn
Date: 2025-10-15T20:10:22+01:00
New Revision: eeca8947588ef1276b6f9ed8c5bb4cdb499f8611

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

LOG: [VPlan] Use switch over opcodes in verifier (NFC).

Preparation to make it easier to extend to verify additional opcodes.

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 5262af61d5978..91734a10cb2c8 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -298,11 +298,16 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
         return false;
       }
     }
-    if (const auto *EVL = dyn_cast<VPInstruction>(&R)) {
-      if (EVL->getOpcode() == VPInstruction::ExplicitVectorLength &&
-          !verifyEVLRecipe(*EVL)) {
-        errs() << "EVL VPValue is not used correctly\n";
-        return false;
+    if (const auto *VPI = dyn_cast<VPInstruction>(&R)) {
+      switch (VPI->getOpcode()) {
+      case VPInstruction::ExplicitVectorLength:
+        if (!verifyEVLRecipe(*VPI)) {
+          errs() << "EVL VPValue is not used correctly\n";
+          return false;
+        }
+        break;
+      default:
+        break;
       }
     }
   }


        


More information about the llvm-commits mailing list