summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-21 18:49:29 +0000
committerChris Lattner <sabre@nondot.org>2005-08-21 18:49:29 +0000
commit154b2bc59b2df75b8e5ba46a7a3afdf61ae9e138 (patch)
tree2bf2121ff0c20a2ad866dbe05f6e346313ab3e9d /llvm/lib/CodeGen/SelectionDAG
parent539c3fa8637734266f14178139936eb4576fcd46 (diff)
downloadbcm5719-llvm-154b2bc59b2df75b8e5ba46a7a3afdf61ae9e138.tar.gz
bcm5719-llvm-154b2bc59b2df75b8e5ba46a7a3afdf61ae9e138.zip
Add support for basic blocks, fix a bug in result # computation
llvm-svn: 22948
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 650242ba555..485ef36efa2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -80,7 +80,7 @@ unsigned SimpleSched::Emit(SDOperand Op) {
// nodes. Check that the DAG matches the TD files's expectation of #
// operands.
unsigned NumResults = Op.Val->getNumValues();
- if (NumResults && Op.getOperand(NumResults-1).getValueType() == MVT::Other)
+ if (NumResults && Op.Val->getValueType(NumResults-1) == MVT::Other)
--NumResults;
#ifndef _NDEBUG
unsigned Operands = Op.getNumOperands();
@@ -118,6 +118,9 @@ unsigned SimpleSched::Emit(SDOperand Op) {
} else if (GlobalAddressSDNode *TGA =
dyn_cast<GlobalAddressSDNode>(Op.getOperand(i))) {
MI->addGlobalAddressOperand(TGA->getGlobal(), false, 0);
+ } else if (BasicBlockSDNode *BB =
+ dyn_cast<BasicBlockSDNode>(Op.getOperand(i))) {
+ MI->addMachineBasicBlockOperand(BB->getBasicBlock());
} else {
unsigned R = Emit(Op.getOperand(i));
// Add an operand, unless this corresponds to a chain node.
@@ -133,7 +136,9 @@ unsigned SimpleSched::Emit(SDOperand Op) {
default:
Op.Val->dump();
assert(0 && "This target-independent node should have been selected!");
- case ISD::EntryToken: break;
+ case ISD::EntryToken:
+ case ISD::BasicBlock:
+ break;
case ISD::TokenFactor:
for (unsigned i = 0, e = Op.getNumOperands(); i != e; ++i)
Emit(Op.getOperand(i));
OpenPOWER on IntegriCloud