[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jul 29 17:04:23 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.147 -> 1.148
---
Log message:
Allow targets to have custom expanders for FP_TO_*INT conversions where
both the src and dest values are legal
---
Diffs of the changes: (+9 -3)
LegalizeDAG.cpp | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.147 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.148
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.147 Thu Jul 28 19:33:32 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jul 29 19:04:12 2005
@@ -1570,21 +1570,27 @@
case ISD::FP_TO_UINT:
switch (getTypeAction(Node->getOperand(0).getValueType())) {
case Legal:
+ Tmp1 = LegalizeOp(Node->getOperand(0));
+
switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))){
default: assert(0 && "Unknown operation action!");
case TargetLowering::Expand:
assert(0 && "Cannot expand FP_TO*INT yet");
case TargetLowering::Promote:
- Result = PromoteLegalFP_TO_INT(LegalizeOp(Node->getOperand(0)),
- Node->getValueType(0),
+ Result = PromoteLegalFP_TO_INT(Tmp1, Node->getValueType(0),
Node->getOpcode() == ISD::FP_TO_SINT);
AddLegalizedOperand(Op, Result);
return Result;
case TargetLowering::Legal:
break;
+ case TargetLowering::Custom:
+ Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1);
+ Result = TLI.LowerOperation(Result, DAG);
+ AddLegalizedOperand(Op, Result);
+ NeedsAnotherIteration = true;
+ return Result;
}
- Tmp1 = LegalizeOp(Node->getOperand(0));
if (Tmp1 != Node->getOperand(0))
Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1);
break;
More information about the llvm-commits
mailing list