[llvm-commits] [llvm] r46014 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp TargetLowering.cpp
Chris Lattner
sabre at nondot.org
Tue Jan 15 13:58:08 PST 2008
Author: lattner
Date: Tue Jan 15 15:58:08 2008
New Revision: 46014
URL: http://llvm.org/viewvc/llvm-project?rev=46014&view=rev
Log:
Add support for targets that have a legal ISD::TRAP.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=46014&r1=46013&r2=46014&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jan 15 15:58:08 2008
@@ -3734,24 +3734,29 @@
break;
}
}
- case ISD::TRAP: {
+ case ISD::TRAP: {
MVT::ValueType VT = Node->getValueType(0);
switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
default: assert(0 && "This action not supported for this op yet!");
+ case TargetLowering::Legal:
+ Tmp1 = LegalizeOp(Node->getOperand(0));
+ Result = DAG.UpdateNodeOperands(Result, Tmp1);
+ break;
case TargetLowering::Custom:
Result = TLI.LowerOperation(Op, DAG);
if (Result.Val) break;
// Fall Thru
- case TargetLowering::Legal:
+ case TargetLowering::Expand:
// If this operation is not supported, lower it to 'abort()' call
- SDOperand Chain = LegalizeOp(Node->getOperand(0));
+ Tmp1 = LegalizeOp(Node->getOperand(0));
TargetLowering::ArgListTy Args;
std::pair<SDOperand,SDOperand> CallResult =
- TLI.LowerCallTo(Chain, Type::VoidTy, false, false, CallingConv::C, false,
+ TLI.LowerCallTo(Tmp1, Type::VoidTy, false, false, CallingConv::C, false,
DAG.getExternalSymbol("abort", MVT::Other), Args, DAG);
Result = CallResult.second;
break;
}
+ break;
}
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=46014&r1=46013&r2=46014&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Jan 15 15:58:08 2008
@@ -175,6 +175,9 @@
setOperationAction(ISD::FGETSIGN, (MVT::ValueType)VT, Expand);
}
+ // Default ISD::TRAP to expand (which turns it into abort).
+ setOperationAction(ISD::TRAP, MVT::Other, Expand);
+
IsLittleEndian = TD->isLittleEndian();
UsesGlobalOffsetTable = false;
ShiftAmountTy = SetCCResultTy = PointerTy = getValueType(TD->getIntPtrType());
More information about the llvm-commits
mailing list