Skip to content

Commit eeca894

Browse files
committed
[VPlan] Use switch over opcodes in verifier (NFC).
Preparation to make it easier to extend to verify additional opcodes.
1 parent 86b89a6 commit eeca894

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,16 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
298298
return false;
299299
}
300300
}
301-
if (const auto *EVL = dyn_cast<VPInstruction>(&R)) {
302-
if (EVL->getOpcode() == VPInstruction::ExplicitVectorLength &&
303-
!verifyEVLRecipe(*EVL)) {
304-
errs() << "EVL VPValue is not used correctly\n";
305-
return false;
301+
if (const auto *VPI = dyn_cast<VPInstruction>(&R)) {
302+
switch (VPI->getOpcode()) {
303+
case VPInstruction::ExplicitVectorLength:
304+
if (!verifyEVLRecipe(*VPI)) {
305+
errs() << "EVL VPValue is not used correctly\n";
306+
return false;
307+
}
308+
break;
309+
default:
310+
break;
306311
}
307312
}
308313
}

0 commit comments

Comments
 (0)