[llvm-commits] [llvm] r52895 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeIntegerTypes.cpp LegalizeTypes.h
Duncan Sands
baldrick at free.fr
Mon Jun 30 04:50:17 PDT 2008
Author: baldrick
Date: Mon Jun 30 06:50:11 2008
New Revision: 52895
URL: http://llvm.org/viewvc/llvm-project?rev=52895&view=rev
Log:
Support for promoting select_cc operands.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=52895&r1=52894&r2=52895&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Mon Jun 30 06:50:11 2008
@@ -444,6 +444,7 @@
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_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 @@
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);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=52895&r1=52894&r2=52895&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Mon Jun 30 06:50:11 2008
@@ -248,6 +248,7 @@
SDOperand PromoteIntOp_INSERT_VECTOR_ELT(SDNode *N, unsigned OpNo);
SDOperand PromoteIntOp_MEMBARRIER(SDNode *N);
SDOperand PromoteIntOp_SELECT(SDNode *N, unsigned OpNo);
+ SDOperand PromoteIntOp_SELECT_CC(SDNode *N, unsigned OpNo);
SDOperand PromoteIntOp_SETCC(SDNode *N, unsigned OpNo);
SDOperand PromoteIntOp_SIGN_EXTEND(SDNode *N);
SDOperand PromoteIntOp_STORE(StoreSDNode *N, unsigned OpNo);
@@ -428,7 +429,6 @@
void SplitVecRes_UnOp(SDNode *N, SDOperand &Lo, SDOperand &Hi);
void SplitVecRes_BinOp(SDNode *N, SDOperand &Lo, SDOperand &Hi);
void SplitVecRes_FPOWI(SDNode *N, SDOperand &Lo, SDOperand &Hi);
- void SplitVecRes_SELECT(SDNode *N, SDOperand &Lo, SDOperand &Hi);
// Vector Operand Splitting: <128 x ty> -> 2 x <64 x ty>.
bool SplitOperand(SDNode *N, unsigned OpNo);
More information about the llvm-commits
mailing list