1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Added check to avoid generating extract subvector beyond the end of the vector when normalizing vector shuffles.

llvm-svn: 59900
This commit is contained in:
Mon P Wang 2008-11-23 04:35:05 +00:00
parent 2fc3f5daa5
commit e1c40f4258

View File

@ -2423,7 +2423,8 @@ void SelectionDAGLowering::visitShuffleVector(User &I) {
StartIdx[Input] = 0;
} else {
StartIdx[Input] = (MinRange[Input]/MaskNumElts)*MaskNumElts;
if (MaxRange[Input] - StartIdx[Input] < MaskNumElts)
if (MaxRange[Input] - StartIdx[Input] < MaskNumElts &&
StartIdx[Input] + MaskNumElts < SrcNumElts)
RangeUse[Input] = 1; // Extract from a multiple of the mask length.
}
}