summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commit2967480f54bfcdc6243b59d559cc6e7ad5b791a2 (patch)
tree249f4b05cc8b2bb31028ce8c43776063e2c64e0b /llvm/lib/CodeGen
parentcdf25053eef45823c1aa756a1ef5f13c820616b4 (diff)
downloadbcm5719-llvm-2967480f54bfcdc6243b59d559cc6e7ad5b791a2.tar.gz
bcm5719-llvm-2967480f54bfcdc6243b59d559cc6e7ad5b791a2.zip
Added check to avoid generating extract subvector beyond the end of the vector when normalizing vector shuffles.
llvm-svn: 59900
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 94170420d0f..f3948f9ee8a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/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.
}
}
OpenPOWER on IntegriCloud