mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-13 10:32:06 +00:00
Token chain results are not always the first or last result. Consider copyfromreg nodes, where they are the middle result (the flag result is last)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bc0f46097d
commit
c0ab5226cc
@ -3016,6 +3016,7 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
|
|||||||
Tmp2 = LegalizeOp(Node->getOperand(1));
|
Tmp2 = LegalizeOp(Node->getOperand(1));
|
||||||
Result = DAG.getNode(ISD::SRL, NVT, Tmp1, Tmp2);
|
Result = DAG.getNode(ISD::SRL, NVT, Tmp1, Tmp2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ISD::LOAD:
|
case ISD::LOAD:
|
||||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||||
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
|
Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
|
||||||
@ -3374,11 +3375,24 @@ static SDNode *FindCallSeqEnd(SDNode *Node) {
|
|||||||
if (Node->use_empty())
|
if (Node->use_empty())
|
||||||
return 0; // No CallSeqEnd
|
return 0; // No CallSeqEnd
|
||||||
|
|
||||||
|
// The chain is usually at the end.
|
||||||
SDOperand TheChain(Node, Node->getNumValues()-1);
|
SDOperand TheChain(Node, Node->getNumValues()-1);
|
||||||
if (TheChain.getValueType() != MVT::Other)
|
if (TheChain.getValueType() != MVT::Other) {
|
||||||
|
// Sometimes it's at the beginning.
|
||||||
TheChain = SDOperand(Node, 0);
|
TheChain = SDOperand(Node, 0);
|
||||||
if (TheChain.getValueType() != MVT::Other)
|
if (TheChain.getValueType() != MVT::Other) {
|
||||||
return 0;
|
// Otherwise, hunt for it.
|
||||||
|
for (unsigned i = 1, e = Node->getNumValues(); i != e; ++i)
|
||||||
|
if (Node->getValueType(i) == MVT::Other) {
|
||||||
|
TheChain = SDOperand(Node, i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, we walked into a node without a chain.
|
||||||
|
if (TheChain.getValueType() != MVT::Other)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (SDNode::use_iterator UI = Node->use_begin(),
|
for (SDNode::use_iterator UI = Node->use_begin(),
|
||||||
E = Node->use_end(); UI != E; ++UI) {
|
E = Node->use_end(); UI != E; ++UI) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user