mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Fold the adjust_trampoline intrinsic into
init_trampoline. There is now only one trampoline intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41841 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3384,21 +3384,6 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ISD::ADJUST_TRAMP: {
|
||||
Tmp1 = LegalizeOp(Node->getOperand(0));
|
||||
switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
|
||||
default: assert(0 && "This action is not supported yet!");
|
||||
case TargetLowering::Custom:
|
||||
Result = DAG.UpdateNodeOperands(Result, Tmp1);
|
||||
Result = TLI.LowerOperation(Result, DAG);
|
||||
if (Result.Val) break;
|
||||
// FALL THROUGH
|
||||
case TargetLowering::Expand:
|
||||
Result = Tmp1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ISD::TRAMPOLINE: {
|
||||
SDOperand Ops[6];
|
||||
for (unsigned i = 0; i != 6; ++i)
|
||||
@@ -3407,7 +3392,14 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
// The only option for this node is to custom lower it.
|
||||
Result = TLI.LowerOperation(Result, DAG);
|
||||
assert(Result.Val && "Should always custom lower!");
|
||||
break;
|
||||
|
||||
// Since trampoline produces two values, make sure to remember that we
|
||||
// legalized both of them.
|
||||
Tmp1 = LegalizeOp(Result.getValue(1));
|
||||
Result = LegalizeOp(Result);
|
||||
AddLegalizedOperand(SDOperand(Node, 0), Result);
|
||||
AddLegalizedOperand(SDOperand(Node, 1), Tmp1);
|
||||
return Op.ResNo ? Tmp1 : Result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3643,8 +3643,7 @@ std::string SDNode::getOperationName(const SelectionDAG *G) const {
|
||||
case ISD::DEBUG_LOC: return "debug_loc";
|
||||
|
||||
// Trampolines
|
||||
case ISD::ADJUST_TRAMP: return "adjust_tramp";
|
||||
case ISD::TRAMPOLINE: return "trampoline";
|
||||
case ISD::TRAMPOLINE: return "trampoline";
|
||||
|
||||
case ISD::CONDCODE:
|
||||
switch (cast<CondCodeSDNode>(this)->get()) {
|
||||
|
||||
@@ -2881,12 +2881,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
||||
// Discard annotate attributes
|
||||
return 0;
|
||||
|
||||
case Intrinsic::adjust_trampoline: {
|
||||
SDOperand Arg = getValue(I.getOperand(1));
|
||||
setValue(&I, DAG.getNode(ISD::ADJUST_TRAMP, TLI.getPointerTy(), Arg));
|
||||
return 0;
|
||||
}
|
||||
|
||||
case Intrinsic::init_trampoline: {
|
||||
const Function *F =
|
||||
cast<Function>(IntrinsicInst::StripPointerCasts(I.getOperand(2)));
|
||||
@@ -2899,7 +2893,13 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
||||
Ops[4] = DAG.getSrcValue(I.getOperand(1));
|
||||
Ops[5] = DAG.getSrcValue(F);
|
||||
|
||||
DAG.setRoot(DAG.getNode(ISD::TRAMPOLINE, MVT::Other, Ops, 6));
|
||||
SDOperand Tmp = DAG.getNode(ISD::TRAMPOLINE,
|
||||
DAG.getNodeValueTypes(TLI.getPointerTy(),
|
||||
MVT::Other), 2,
|
||||
Ops, 6);
|
||||
|
||||
setValue(&I, Tmp);
|
||||
DAG.setRoot(Tmp.getValue(1));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user