Skip to content

Commit d8b01f9

Browse files
committed
Use [[maybe_unused]] + assert
1 parent b24bfdb commit d8b01f9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,19 +2460,21 @@ void VPlanTransforms::canonicalizeEVLLoops(VPlan &Plan) {
24602460
VPBasicBlock *HeaderVPBB = EVLPhi->getParent();
24612461
VPValue *EVLIncrement = EVLPhi->getBackedgeValue();
24622462
VPValue *AVL;
2463-
if (!match(EVLIncrement,
2464-
m_c_Add(m_ZExtOrSelf(m_EVL(m_VPValue(AVL))), m_Specific(EVLPhi))))
2465-
llvm_unreachable("Didn't find AVL?");
2463+
[[maybe_unused]] bool FoundAVL =
2464+
match(EVLIncrement,
2465+
m_c_Add(m_ZExtOrSelf(m_EVL(m_VPValue(AVL))), m_Specific(EVLPhi)));
2466+
assert(FoundAVL && "Didn't find AVL?");
24662467

24672468
// The AVL may be capped to a safe distance.
24682469
VPValue *SafeAVL;
24692470
if (match(AVL, m_Select(m_VPValue(), m_VPValue(SafeAVL), m_VPValue())))
24702471
AVL = SafeAVL;
24712472

24722473
VPValue *AVLNext;
2473-
if (!match(AVL, m_VPInstruction<Instruction::PHI>(
2474-
m_Specific(Plan.getTripCount()), m_VPValue(AVLNext))))
2475-
llvm_unreachable("Didn't find AVL backedge?");
2474+
[[maybe_unused]] bool FoundAVLNext =
2475+
match(AVL, m_VPInstruction<Instruction::PHI>(
2476+
m_Specific(Plan.getTripCount()), m_VPValue(AVLNext)));
2477+
assert(FoundAVLNext && "Didn't find AVL backedge?");
24762478

24772479
// Convert EVLPhi to concrete recipe.
24782480
auto *ScalarR =

0 commit comments

Comments
 (0)