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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mon P Wang 2008-11-23 04:35:05 +00:00
parent dccb025768
commit 6cce3dae90

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.
}
}