[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri May 13 22:34:38 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.123 -> 1.124
---
Log message:

Allow targets to have a custom int64->fp expander if desired


---
Diffs of the changes:  (+11 -0)

 LegalizeDAG.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.123 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.124
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.123	Fri May 13 13:50:42 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Sat May 14 00:33:54 2005
@@ -2176,6 +2176,17 @@
     return DAG.getNode(ISD::ADD, DestTy, SignedConv, FudgeInReg);
   }
 
+  // Check to see if the target has a custom way to lower this.  If so, use it.
+  switch (TLI.getOperationAction(ISD::SINT_TO_FP, Source.getValueType())) {
+  default: assert(0 && "This action not implemented for this operation!");
+  case TargetLowering::Legal:
+  case TargetLowering::Expand:
+    break;   // This case is handled below.
+  case TargetLowering::Custom:
+    Source = DAG.getNode(ISD::SINT_TO_FP, DestTy, Source);
+    return LegalizeOp(TLI.LowerOperation(Source));
+  }
+
   // Expand the source, then glue it back together for the call.  We must expand
   // the source in case it is shared (this pass of legalize must traverse it).
   SDOperand SrcLo, SrcHi;






More information about the llvm-commits mailing list