We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f27edf3 commit 9ebb6e4Copy full SHA for 9ebb6e4
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -685,7 +685,8 @@ bool VectorCombine::foldInsExtFNeg(Instruction &I) {
685
if (!SrcVecTy || DstVecScalarTy != SrcVecTy->getScalarType())
686
return false;
687
688
- // Ignore bogus insert/extract index.
+ // Ignore if insert/extract index is out of bounds or destination vector has
689
+ // one element
690
unsigned NumDstElts = DstVecTy->getNumElements();
691
unsigned NumSrcElts = SrcVecTy->getNumElements();
692
if (InsIdx >= NumDstElts || ExtIdx >= NumSrcElts || NumDstElts == 1)
0 commit comments