Skip to content

Commit 3b75045

Browse files
committed
Returns false early if condition 'ExtIdx>=NumSrcElts' is met
1 parent 1224a74 commit 3b75045

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
@@ -3076,7 +3076,7 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
30763076

30773077
unsigned NumDstElts = DstVecTy->getNumElements();
30783078
unsigned NumSrcElts = SrcVecTy->getNumElements();
3079-
if (InsIdx >= NumDstElts || NumDstElts == 1)
3079+
if (InsIdx >= NumDstElts || ExtIdx >= NumSrcElts || NumDstElts == 1)
30803080
return false;
30813081

30823082
// Insertion into poison is a cheaper single operand shuffle.

0 commit comments

Comments
 (0)