mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
Add support for basic blocks, fix a bug in result # computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -80,7 +80,7 @@ unsigned SimpleSched::Emit(SDOperand Op) {
|
|||||||
// nodes. Check that the DAG matches the TD files's expectation of #
|
// nodes. Check that the DAG matches the TD files's expectation of #
|
||||||
// operands.
|
// operands.
|
||||||
unsigned NumResults = Op.Val->getNumValues();
|
unsigned NumResults = Op.Val->getNumValues();
|
||||||
if (NumResults && Op.getOperand(NumResults-1).getValueType() == MVT::Other)
|
if (NumResults && Op.Val->getValueType(NumResults-1) == MVT::Other)
|
||||||
--NumResults;
|
--NumResults;
|
||||||
#ifndef _NDEBUG
|
#ifndef _NDEBUG
|
||||||
unsigned Operands = Op.getNumOperands();
|
unsigned Operands = Op.getNumOperands();
|
||||||
@@ -118,6 +118,9 @@ unsigned SimpleSched::Emit(SDOperand Op) {
|
|||||||
} else if (GlobalAddressSDNode *TGA =
|
} else if (GlobalAddressSDNode *TGA =
|
||||||
dyn_cast<GlobalAddressSDNode>(Op.getOperand(i))) {
|
dyn_cast<GlobalAddressSDNode>(Op.getOperand(i))) {
|
||||||
MI->addGlobalAddressOperand(TGA->getGlobal(), false, 0);
|
MI->addGlobalAddressOperand(TGA->getGlobal(), false, 0);
|
||||||
|
} else if (BasicBlockSDNode *BB =
|
||||||
|
dyn_cast<BasicBlockSDNode>(Op.getOperand(i))) {
|
||||||
|
MI->addMachineBasicBlockOperand(BB->getBasicBlock());
|
||||||
} else {
|
} else {
|
||||||
unsigned R = Emit(Op.getOperand(i));
|
unsigned R = Emit(Op.getOperand(i));
|
||||||
// Add an operand, unless this corresponds to a chain node.
|
// Add an operand, unless this corresponds to a chain node.
|
||||||
@@ -133,7 +136,9 @@ unsigned SimpleSched::Emit(SDOperand Op) {
|
|||||||
default:
|
default:
|
||||||
Op.Val->dump();
|
Op.Val->dump();
|
||||||
assert(0 && "This target-independent node should have been selected!");
|
assert(0 && "This target-independent node should have been selected!");
|
||||||
case ISD::EntryToken: break;
|
case ISD::EntryToken:
|
||||||
|
case ISD::BasicBlock:
|
||||||
|
break;
|
||||||
case ISD::TokenFactor:
|
case ISD::TokenFactor:
|
||||||
for (unsigned i = 0, e = Op.getNumOperands(); i != e; ++i)
|
for (unsigned i = 0, e = Op.getNumOperands(); i != e; ++i)
|
||||||
Emit(Op.getOperand(i));
|
Emit(Op.getOperand(i));
|
||||||
|
Reference in New Issue
Block a user