Skip to content

Commit 6e08857

Browse files
committed
fix wrong boundary check
1 parent c315e4e commit 6e08857

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ bool VectorCombine::foldInsExtFNeg(Instruction &I) {
721721
// one element
722722
unsigned NumDstElts = DstVecTy->getNumElements();
723723
unsigned NumSrcElts = SrcVecTy->getNumElements();
724-
if (InsIdx >= NumDstElts || ExtIdx >= NumSrcElts || NumDstElts == 1)
724+
if (ExtIdx > NumSrcElts || InsIdx >= NumDstElts ||
725+
NumDstElts == 1)
725726
return false;
726727

727728
// We are inserting the negated element into the same lane that we extracted

0 commit comments

Comments
 (0)