aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index a96c59b340..218e130580 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2092,9 +2092,16 @@ SDOperand DAGCombiner::visitBRTWOWAY_CC(SDNode *N) {
if (SCCC && SCCC->isNullValue())
return DAG.getNode(ISD::BR, MVT::Other, Chain, N5);
// fold to a simpler setcc
- if (SCC.Val && SCC.getOpcode() == ISD::SETCC)
- return DAG.getBR2Way_CC(Chain, SCC.getOperand(2), SCC.getOperand(0),
- SCC.getOperand(1), N4, N5);
+ if (SCC.Val && SCC.getOpcode() == ISD::SETCC) {
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Chain);
+ Ops.push_back(SCC.getOperand(2));
+ Ops.push_back(SCC.getOperand(0));
+ Ops.push_back(SCC.getOperand(1));
+ Ops.push_back(N4);
+ Ops.push_back(N5);
+ return DAG.getNode(ISD::BRTWOWAY_CC, MVT::Other, Ops);
+ }
return SDOperand();
}