summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-12-13 01:34:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-12-13 01:34:32 +0000
commitbf0baa9de7f84cbd9fdd810aa5ae3566bad52596 (patch)
tree2864811df9e3c6fa94c198313769ecaae3011c56 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent79e1cdb00b85e9459b12df2f5fa692b490da5f36 (diff)
downloadbcm5719-llvm-bf0baa9de7f84cbd9fdd810aa5ae3566bad52596.tar.gz
bcm5719-llvm-bf0baa9de7f84cbd9fdd810aa5ae3566bad52596.zip
Fix a bug in DAGCombiner::MatchBSwapHWord. Make sure the node has operands before referencing them. rdar://12868039
llvm-svn: 170078
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 893cf2036a4..7c54d17275a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2984,7 +2984,8 @@ SDValue DAGCombiner::MatchBSwapHWord(SDNode *N, SDValue N0, SDValue N1) {
SDValue N00 = N0.getOperand(0);
SDValue N01 = N0.getOperand(1);
- if (N1.getOpcode() == ISD::OR) {
+ if (N1.getOpcode() == ISD::OR &&
+ N00.getNumOperands() == 2 && N01.getNumOperands() == 2) {
// (or (or (and), (and)), (or (and), (and)))
SDValue N000 = N00.getOperand(0);
if (!isBSwapHWordElement(N000, Parts))
OpenPOWER on IntegriCloud