summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-01-17 04:44:50 +0000
committerCraig Topper <craig.topper@gmail.com>2012-01-17 04:44:50 +0000
commit37b10ef250d78aae674f5ff836271eced5da600d (patch)
treee8e71481191e7224391b1e33111c812d3473beff /llvm/lib
parentb48ed1a4cb032b4cfe7d97db1d1429d1aa4a9860 (diff)
downloadbcm5719-llvm-37b10ef250d78aae674f5ff836271eced5da600d.tar.gz
bcm5719-llvm-37b10ef250d78aae674f5ff836271eced5da600d.zip
Fix a crasher when PerformShiftCombine receives a BUILD_VECTOR of all UNDEF. Probably could use better handling in DAG combine or getNode. Fixes PR11772.
llvm-svn: 148285
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index b5198c8510f..a0fd4316c38 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -13430,6 +13430,11 @@ static SDValue PerformShiftCombine(SDNode* N, SelectionDAG &DAG,
BaseShAmt = Arg;
break;
}
+ // Handle the case where the build_vector is all undef
+ // FIXME: Should DAG allow this?
+ if (i == NumElts)
+ return SDValue();
+
for (; i != NumElts; ++i) {
SDValue Arg = ShAmtOp.getOperand(i);
if (Arg.getOpcode() == ISD::UNDEF) continue;
OpenPOWER on IntegriCloud