aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-07-04 11:47:58 +0000
committerDuncan Sands <baldrick@free.fr>2008-07-04 11:47:58 +0000
commit126d90770bdb17e6925b2fe26de99aa079b7b9b3 (patch)
tree4bf58791eda553cebec7a8897d0abcad610325f9 /lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
parentececf99c07febbcaeec73822519f0d36d3ee50c4 (diff)
Rather than having a different custom legalization
hook for each way in which a result type can be legalized (promotion, expansion, softening etc), just use one: ReplaceNodeResults, which returns a node with exactly the same result types as the node passed to it, but presumably with a bunch of custom code behind the scenes. No change if the new LegalizeTypes infrastructure is not turned on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index b2580f5fa7..bfe2ce6d88 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -48,20 +48,17 @@ void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) {
cerr << "\n");
SDOperand R = SDOperand();
- // FIXME: Custom lowering for float-to-int?
-#if 0
- // See if the target wants to custom convert this node to an integer.
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
+ // See if the target wants to custom expand this node.
+ if (TLI.getOperationAction(N->getOpcode(), N->getValueType(ResNo)) ==
TargetLowering::Custom) {
// If the target wants to, allow it to lower this itself.
- if (SDNode *P = TLI.FloatToIntOperationResult(N, DAG)) {
+ if (SDNode *P = TLI.ReplaceNodeResults(N, DAG)) {
// Everything that once used N now uses P. We are guaranteed that the
// result value types of N and the result value types of P match.
ReplaceNodeWith(N, P);
return;
}
}
-#endif
switch (N->getOpcode()) {
default:
@@ -315,12 +312,9 @@ bool DAGTypeLegalizer::SoftenFloatOperand(SDNode *N, unsigned OpNo) {
cerr << "\n");
SDOperand Res(0, 0);
- // FIXME: Custom lowering for float-to-int?
-#if 0
if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
== TargetLowering::Custom)
- Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
-#endif
+ Res = TLI.LowerOperation(SDOperand(N, OpNo), DAG);
if (Res.Val == 0) {
switch (N->getOpcode()) {
@@ -517,10 +511,10 @@ void DAGTypeLegalizer::ExpandFloatResult(SDNode *N, unsigned ResNo) {
Lo = Hi = SDOperand();
// See if the target wants to custom expand this node.
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom) {
+ if (TLI.getOperationAction(N->getOpcode(), N->getValueType(ResNo)) ==
+ TargetLowering::Custom) {
// If the target wants to, allow it to lower this itself.
- if (SDNode *P = TLI.ExpandOperationResult(N, DAG)) {
+ if (SDNode *P = TLI.ReplaceNodeResults(N, DAG)) {
// Everything that once used N now uses P. We are guaranteed that the
// result value types of N and the result value types of P match.
ReplaceNodeWith(N, P);
@@ -742,7 +736,7 @@ bool DAGTypeLegalizer::ExpandFloatOperand(SDNode *N, unsigned OpNo) {
if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
== TargetLowering::Custom)
- Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
+ Res = TLI.LowerOperation(SDOperand(N, OpNo), DAG);
if (Res.Val == 0) {
switch (N->getOpcode()) {