MEMMOVE,
MEMCPY,
- // ADJCALLSTACKDOWN/ADJCALLSTACKUP - These operators mark the beginning and
- // end of a call sequence and indicate how much the stack pointer needs to
- // be adjusted for that particular call. The first operand is a chain, the
- // second is a ConstantSDNode of intptr type.
- ADJCALLSTACKDOWN, // Beginning of a call sequence
- ADJCALLSTACKUP, // End of a call sequence
+ // CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of
+ // a call sequence, and carry arbitrary information that target might want
+ // to know. The first operand is a chain, the rest are specified by the
+ // target and not touched by the DAG optimizers.
+ CALLSEQ_START, // Beginning of a call sequence
+ CALLSEQ_END, // End of a call sequence
// SRCVALUE - This corresponds to a Value*, and is used to associate memory
// locations with their value. This allows one use alias analysis
break;
}
- case ISD::ADJCALLSTACKDOWN:
- case ISD::ADJCALLSTACKUP:
+ case ISD::CALLSEQ_START:
+ case ISD::CALLSEQ_END:
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
// There is no need to legalize the size argument (Operand #1)
Tmp2 = Node->getOperand(0);
DAG.getNode(ISD::PCMARKER, MVT::Other, Tmp2,
DAG.getConstant(0, MVT::i32));
}
- // Note that we do not create new ADJCALLSTACK DOWN/UP nodes here. These
+ // Note that we do not create new CALLSEQ_DOWN/UP nodes here. These
// nodes are treated specially and are mutated in place. This makes the dag
// legalization process more efficient and also makes libcall insertion
// easier.
static void FindLatestAdjCallStackDown(SDNode *Node, SDNode *&Found) {
if (Node->getNodeDepth() <= Found->getNodeDepth()) return;
- // If we found an ADJCALLSTACKDOWN, we already know this node occurs later
+ // If we found an CALLSEQ_START, we already know this node occurs later
// than the Found node. Just remember this node and return.
- if (Node->getOpcode() == ISD::ADJCALLSTACKDOWN) {
+ if (Node->getOpcode() == ISD::CALLSEQ_START) {
Found = Node;
return;
}
static void FindEarliestAdjCallStackUp(SDNode *Node, SDNode *&Found) {
if (Found && Node->getNodeDepth() >= Found->getNodeDepth()) return;
- // If we found an ADJCALLSTACKUP, we already know this node occurs earlier
+ // If we found an CALLSEQ_END, we already know this node occurs earlier
// than the Found node. Just remember this node and return.
- if (Node->getOpcode() == ISD::ADJCALLSTACKUP) {
+ if (Node->getOpcode() == ISD::CALLSEQ_END) {
Found = Node;
return;
}
}
/// FindAdjCallStackUp - Given a chained node that is part of a call sequence,
-/// find the ADJCALLSTACKUP node that terminates the call sequence.
+/// find the CALLSEQ_END node that terminates the call sequence.
static SDNode *FindAdjCallStackUp(SDNode *Node) {
- if (Node->getOpcode() == ISD::ADJCALLSTACKUP)
+ if (Node->getOpcode() == ISD::CALLSEQ_END)
return Node;
if (Node->use_empty())
return 0; // No adjcallstackup
for (SDNode::use_iterator UI = Node->use_begin(),
E = Node->use_end(); ; ++UI) {
- assert(UI != E && "Didn't find a user of the tokchain, no ADJCALLSTACKUP!");
+ assert(UI != E && "Didn't find a user of the tokchain, no CALLSEQ_END!");
// Make sure to only follow users of our token chain.
SDNode *User = *UI;
}
/// FindAdjCallStackDown - Given a chained node that is part of a call sequence,
-/// find the ADJCALLSTACKDOWN node that initiates the call sequence.
+/// find the CALLSEQ_START node that initiates the call sequence.
static SDNode *FindAdjCallStackDown(SDNode *Node) {
assert(Node && "Didn't find adjcallstackdown for a call??");
- if (Node->getOpcode() == ISD::ADJCALLSTACKDOWN) return Node;
+ if (Node->getOpcode() == ISD::CALLSEQ_START) return Node;
assert(Node->getOperand(0).getValueType() == MVT::Other &&
"Node doesn't have a token chain argument!");
FindLatestAdjCallStackDown(OpNode, LatestAdjCallStackDown);
//std::cerr<<"Found node: "; LatestAdjCallStackDown->dump(); std::cerr <<"\n";
- // It is possible that no ISD::ADJCALLSTACKDOWN was found because there is no
+ // It is possible that no ISD::CALLSEQ_START was found because there is no
// previous call in the function. LatestCallStackDown may in that case be
- // the entry node itself. Do not attempt to find a matching ADJCALLSTACKUP
- // unless LatestCallStackDown is an ADJCALLSTACKDOWN.
- if (LatestAdjCallStackDown->getOpcode() == ISD::ADJCALLSTACKDOWN)
+ // the entry node itself. Do not attempt to find a matching CALLSEQ_END
+ // unless LatestCallStackDown is an CALLSEQ_START.
+ if (LatestAdjCallStackDown->getOpcode() == ISD::CALLSEQ_START)
LatestAdjCallStackUp = FindAdjCallStackUp(LatestAdjCallStackDown);
else
LatestAdjCallStackUp = Entry.Val;
// Memoize this node if possible.
SDNode *N;
- if (Opcode != ISD::ADJCALLSTACKDOWN && Opcode != ISD::ADJCALLSTACKUP) {
+ if (Opcode != ISD::CALLSEQ_START && Opcode != ISD::CALLSEQ_END) {
SDNode *&BON = BinaryOps[std::make_pair(Opcode, std::make_pair(N1, N2))];
if (BON) return SDOperand(BON, 0);
}
// setAdjCallChain - This method changes the token chain of an
-// ADJCALLSTACKDOWN/UP node to be the specified operand.
+// CALLSEQ_START/END node to be the specified operand.
void SDNode::setAdjCallChain(SDOperand N) {
assert(N.getValueType() == MVT::Other);
- assert((getOpcode() == ISD::ADJCALLSTACKDOWN ||
- getOpcode() == ISD::ADJCALLSTACKUP) && "Cannot adjust this node!");
+ assert((getOpcode() == ISD::CALLSEQ_START ||
+ getOpcode() == ISD::CALLSEQ_END) && "Cannot adjust this node!");
Operands[0].Val->removeUser(this);
Operands[0] = N;
case ISD::BRCONDTWOWAY: return "brcondtwoway";
case ISD::RET: return "ret";
case ISD::CALL: return "call";
- case ISD::ADJCALLSTACKDOWN: return "adjcallstackdown";
- case ISD::ADJCALLSTACKUP: return "adjcallstackup";
+ case ISD::CALLSEQ_START: return "callseq_end";
+ case ISD::CALLSEQ_END: return "callseq_start";
// Other operators
case ISD::LOAD: return "load";
if (Args.size() > 6)
NumBytes = (Args.size() - 6) * 8;
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
std::vector<SDOperand> args_to_use;
for (unsigned i = 0, e = Args.size(); i != e; ++i)
SDOperand TheCall = SDOperand(DAG.getCall(RetVals,
Chain, Callee, args_to_use), 0);
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::ADJCALLSTACKUP, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
return std::make_pair(TheCall, Chain);
}
SelectExpr(N);
return;
- case ISD::ADJCALLSTACKDOWN:
- case ISD::ADJCALLSTACKUP:
+ case ISD::CALLSEQ_START:
+ case ISD::CALLSEQ_END:
Select(N.getOperand(0));
Tmp1 = cast<ConstantSDNode>(N.getOperand(1))->getValue();
- Opc = N.getOpcode() == ISD::ADJCALLSTACKDOWN ? Alpha::ADJUSTSTACKDOWN :
+ Opc = N.getOpcode() == ISD::CALLSEQ_START ? Alpha::ADJUSTSTACKDOWN :
Alpha::ADJUSTSTACKUP;
BuildMI(BB, Opc, 1).addImm(Tmp1);
return;
MF.getInfo<IA64FunctionInfo>()->outRegsUsed=
std::max(outRegsUsed, MF.getInfo<IA64FunctionInfo>()->outRegsUsed);
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
std::vector<SDOperand> args_to_use;
SDOperand TheCall = SDOperand(DAG.getCall(RetVals, Chain,
Callee, args_to_use), 0);
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::ADJCALLSTACKUP, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
return std::make_pair(TheCall, Chain);
}
return;
}
- case ISD::ADJCALLSTACKDOWN:
- case ISD::ADJCALLSTACKUP: {
+ case ISD::CALLSEQ_START:
+ case ISD::CALLSEQ_END: {
Select(N.getOperand(0));
Tmp1 = cast<ConstantSDNode>(N.getOperand(1))->getValue();
- Opc = N.getOpcode() == ISD::ADJCALLSTACKDOWN ? IA64::ADJUSTCALLSTACKDOWN :
- IA64::ADJUSTCALLSTACKUP;
+ Opc = N.getOpcode() == ISD::CALLSEQ_START ? IA64::ADJUSTCALLSTACKDOWN :
+ IA64::ADJUSTCALLSTACKUP;
BuildMI(BB, Opc, 1).addImm(Tmp1);
return;
}
unsigned NumBytes = 48;
if (Args.empty()) {
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
} else {
NumBytes = 8 * Args.size(); // All arguments are rounded up to 8 bytes
// Adjust the stack pointer for the new arguments...
// These operations are automatically eliminated by the prolog/epilog pass
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
// Set up a copy of the stack pointer for use loading and storing any
SDOperand TheCall = SDOperand(DAG.getCall(RetVals,
Chain, Callee, args_to_use), 0);
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::ADJCALLSTACKUP, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
return std::make_pair(TheCall, Chain);
}
for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i)
Select(Node->getOperand(i));
return;
- case ISD::ADJCALLSTACKDOWN:
- case ISD::ADJCALLSTACKUP:
+ case ISD::CALLSEQ_START:
+ case ISD::CALLSEQ_END:
Select(N.getOperand(0));
Tmp1 = cast<ConstantSDNode>(N.getOperand(1))->getValue();
- Opc = N.getOpcode() == ISD::ADJCALLSTACKDOWN ? PPC::ADJCALLSTACKDOWN :
+ Opc = N.getOpcode() == ISD::CALLSEQ_START ? PPC::ADJCALLSTACKDOWN :
PPC::ADJCALLSTACKUP;
BuildMI(BB, Opc, 1).addImm(Tmp1);
return;
unsigned NumBytes = 24;
if (Args.empty()) {
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
} else {
for (unsigned i = 0, e = Args.size(); i != e; ++i)
// Adjust the stack pointer for the new arguments...
// These operations are automatically eliminated by the prolog/epilog pass
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
// Set up a copy of the stack pointer for use loading and storing any
SDOperand TheCall = SDOperand(DAG.getCall(RetVals,
Chain, Callee, args_to_use), 0);
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::ADJCALLSTACKUP, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
return std::make_pair(TheCall, Chain);
}
for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i)
Select(Node->getOperand(i));
return;
- case ISD::ADJCALLSTACKDOWN:
- case ISD::ADJCALLSTACKUP:
+ case ISD::CALLSEQ_START:
+ case ISD::CALLSEQ_END:
Select(N.getOperand(0));
Tmp1 = cast<ConstantSDNode>(N.getOperand(1))->getValue();
- Opc = N.getOpcode() == ISD::ADJCALLSTACKDOWN ? PPC::ADJCALLSTACKDOWN :
+ Opc = N.getOpcode() == ISD::CALLSEQ_START ? PPC::ADJCALLSTACKDOWN :
PPC::ADJCALLSTACKUP;
BuildMI(BB, Opc, 1).addImm(Tmp1);
return;
if (Args.empty()) {
// Save zero bytes.
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(0, getPointerTy()));
} else {
for (unsigned i = 0, e = Args.size(); i != e; ++i)
break;
}
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
// Arguments go on the stack in reverse order, as specified by the ABI.
SDOperand TheCall = SDOperand(DAG.getCall(RetVals, Chain, Callee), 0);
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::ADJCALLSTACKUP, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
return std::make_pair(TheCall, Chain);
}
break;
}
- Chain = DAG.getNode(ISD::ADJCALLSTACKDOWN, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_START, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
// Arguments go on the stack in reverse order, as specified by the ABI.
SDOperand TheCall = SDOperand(DAG.getCall(RetVals, Chain, Callee,
RegValuesToPass), 0);
Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
- Chain = DAG.getNode(ISD::ADJCALLSTACKUP, MVT::Other, Chain,
+ Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
DAG.getConstant(NumBytes, getPointerTy()));
return std::make_pair(TheCall, Chain);
}
addFullAddress(BuildMI(BB, Opc, 4+1), AM).addReg(Tmp1);
return;
}
- case ISD::ADJCALLSTACKDOWN:
- case ISD::ADJCALLSTACKUP:
+ case ISD::CALLSEQ_START:
+ case ISD::CALLSEQ_END:
Select(N.getOperand(0));
Tmp1 = cast<ConstantSDNode>(N.getOperand(1))->getValue();
- Opc = N.getOpcode() == ISD::ADJCALLSTACKDOWN ? X86::ADJCALLSTACKDOWN :
- X86::ADJCALLSTACKUP;
+ Opc = N.getOpcode() == ISD::CALLSEQ_START ? X86::ADJCALLSTACKDOWN :
+ X86::ADJCALLSTACKUP;
BuildMI(BB, Opc, 1).addImm(Tmp1);
return;
case ISD::MEMSET: {