aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2008-11-23 04:35:05 +0000
committerMon P Wang <wangmp@apple.com>2008-11-23 04:35:05 +0000
commit6cce3dae900152203a51299e928d8ec738537d6a (patch)
tree73a596fc8f6615323601363acc9aa48cf3722008
parentdccb025768746abb6b6587c2190a69793570887c (diff)
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
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 94170420d0..f3948f9ee8 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -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.
}
}