diff options
author | Duncan Sands <baldrick@free.fr> | 2008-06-30 11:50:11 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-06-30 11:50:11 +0000 |
commit | 7fc8ab81f5f46dcba0f76b1c546a1d11ccbebe26 (patch) | |
tree | 3dfd0f551fd6f262cc7baefc487abe711f70b9b6 /lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | |
parent | fe4f3d6a90887b286b152c1ba846c064ebf10c84 (diff) |
Support for promoting select_cc operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index bad430be4d..cf98b3c9d1 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -444,6 +444,7 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) { case ISD::BRCOND: Res = PromoteIntOp_BRCOND(N, OpNo); break; case ISD::BR_CC: Res = PromoteIntOp_BR_CC(N, OpNo); break; case ISD::SELECT: Res = PromoteIntOp_SELECT(N, OpNo); break; + case ISD::SELECT_CC: Res = PromoteIntOp_SELECT_CC(N, OpNo); break; case ISD::SETCC: Res = PromoteIntOp_SETCC(N, OpNo); break; case ISD::STORE: Res = PromoteIntOp_STORE(cast<StoreSDNode>(N), @@ -568,7 +569,7 @@ SDOperand DAGTypeLegalizer::PromoteIntOp_BRCOND(SDNode *N, unsigned OpNo) { } SDOperand DAGTypeLegalizer::PromoteIntOp_BR_CC(SDNode *N, unsigned OpNo) { - assert(OpNo == 2 && "Don't know how to promote this operand"); + assert(OpNo == 2 && "Don't know how to promote this operand!"); SDOperand LHS = N->getOperand(2); SDOperand RHS = N->getOperand(3); @@ -580,8 +581,20 @@ SDOperand DAGTypeLegalizer::PromoteIntOp_BR_CC(SDNode *N, unsigned OpNo) { N->getOperand(1), LHS, RHS, N->getOperand(4)); } +SDOperand DAGTypeLegalizer::PromoteIntOp_SELECT_CC(SDNode *N, unsigned OpNo) { + assert(OpNo == 0 && "Don't know how to promote this operand!"); + + SDOperand LHS = N->getOperand(0); + SDOperand RHS = N->getOperand(1); + PromoteSetCCOperands(LHS, RHS, cast<CondCodeSDNode>(N->getOperand(4))->get()); + + // The CC (#4) and the possible return values (#2 and #3) have legal types. + return DAG.UpdateNodeOperands(SDOperand(N, 0), LHS, RHS, N->getOperand(2), + N->getOperand(3), N->getOperand(4)); +} + SDOperand DAGTypeLegalizer::PromoteIntOp_SETCC(SDNode *N, unsigned OpNo) { - assert(OpNo == 0 && "Don't know how to promote this operand"); + assert(OpNo == 0 && "Don't know how to promote this operand!"); SDOperand LHS = N->getOperand(0); SDOperand RHS = N->getOperand(1); |