Skip to content

Commit 04af5c4

Browse files
committed
add combining condition for InsIdx >= NumEls
1 parent bacd8ae commit 04af5c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,7 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
27972797
return false;
27982798

27992799
unsigned NumElts = VecTy->getNumElements();
2800-
if (ExtIdx >= NumElts)
2800+
if (ExtIdx >= NumElts || InsIdx >= NumElts)
28012801
return false;
28022802

28032803
SmallVector<int> Mask(NumElts, 0);

0 commit comments

Comments
 (0)