[llvm-commits] [llvm] r43025 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp
Chris Lattner
sabre at nondot.org
Mon Oct 15 20:00:22 PDT 2007
Author: lattner
Date: Mon Oct 15 22:00:22 2007
New Revision: 43025
URL: http://llvm.org/viewvc/llvm-project?rev=43025&view=rev
Log:
implement promotion of select and select_cc, allowing MallocBench/gs to
work with type promotion on x86.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp?rev=43025&r1=43024&r2=43025&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp Mon Oct 15 22:00:22 2007
@@ -130,6 +130,8 @@
SDOperand PromoteResult_SETCC(SDNode *N);
SDOperand PromoteResult_LOAD(LoadSDNode *N);
SDOperand PromoteResult_SimpleIntBinOp(SDNode *N);
+ SDOperand PromoteResult_SELECT (SDNode *N);
+ SDOperand PromoteResult_SELECT_CC(SDNode *N);
// Result Expansion.
void ExpandResult(SDNode *N, unsigned ResNo);
@@ -450,6 +452,10 @@
case ISD::ADD:
case ISD::SUB:
case ISD::MUL: Result = PromoteResult_SimpleIntBinOp(N); break;
+
+ case ISD::SELECT: Result = PromoteResult_SELECT(N); break;
+ case ISD::SELECT_CC: Result = PromoteResult_SELECT_CC(N); break;
+
}
// If Result is null, the sub-method took care of registering the result.
@@ -552,6 +558,19 @@
return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS);
}
+SDOperand DAGTypeLegalizer::PromoteResult_SELECT(SDNode *N) {
+ SDOperand LHS = GetPromotedOp(N->getOperand(1));
+ SDOperand RHS = GetPromotedOp(N->getOperand(2));
+ return DAG.getNode(ISD::SELECT, LHS.getValueType(), N->getOperand(0),LHS,RHS);
+}
+
+SDOperand DAGTypeLegalizer::PromoteResult_SELECT_CC(SDNode *N) {
+ SDOperand LHS = GetPromotedOp(N->getOperand(2));
+ SDOperand RHS = GetPromotedOp(N->getOperand(3));
+ return DAG.getNode(ISD::SELECT_CC, LHS.getValueType(), N->getOperand(0),
+ N->getOperand(1), LHS, RHS, N->getOperand(4));
+}
+
//===----------------------------------------------------------------------===//
// Result Expansion
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list