Skip to content

Commit faf35ac

Browse files
committed
!fixup add assert to ExtractFromEnd
1 parent 8826e81 commit faf35ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,14 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
568568

569569
Value *Res;
570570
if (State.VF.isVector()) {
571+
assert(Offset <= State.VF.getKnownMinValue() &&
572+
"invalid offset to extract from");
571573
// Extract lane VF - Offset from the operand.
572574
Res = State.get(
573575
getOperand(0),
574576
VPIteration(State.UF - 1, VPLane::getLaneFromEnd(State.VF, Offset)));
575577
} else {
576-
assert(State.UF > 1 && "VF and UF cannot both be 1");
578+
assert(Offset <= State.UF && "invalid offset to extract from");
577579
// When loop is unrolled without vectorizing, retrieve UF - Offset.
578580
Res = State.get(getOperand(0), State.UF - Offset);
579581
}

0 commit comments

Comments
 (0)