diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-11-11 10:20:02 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-11-11 10:20:02 +0000 |
| commit | 979bbf48d53e3943f2efbd81a7baa33a5687c3a1 (patch) | |
| tree | 373e7058dd28ddce587b9bb57976da0996484614 /llvm/lib/CodeGen | |
| parent | a36cdcfaf8734731c8c83df7cf6efe7e647f1fba (diff) | |
| download | bcm5719-llvm-979bbf48d53e3943f2efbd81a7baa33a5687c3a1.tar.gz bcm5719-llvm-979bbf48d53e3943f2efbd81a7baa33a5687c3a1.zip | |
Add methods to add implicit def use operands to a MI.
llvm-svn: 31675
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 12 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 11 |
2 files changed, 13 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index ba75e736239..65c164a4eec 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -125,6 +125,18 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { } } +/// addImplicitDefUseOperands - Add all implicit def and use operands to +/// this instruction. +void MachineInstr::addImplicitDefUseOperands() { + const TargetInstrDescriptor &TID = TargetInstrDescriptors[Opcode]; + if (TID.ImplicitDefs) + for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) + addRegOperand(*ImpDefs, true, true); + if (TID.ImplicitUses) + for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) + addRegOperand(*ImpUses, false, true); +} + void MachineInstr::dump() const { std::cerr << " " << *this; diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 307b2b9b70c..cafe3b6ffee 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -442,16 +442,7 @@ void ScheduleDAG::EmitNode(SDNode *Node, } // Emit implicit def / use operands. - if (II.ImplicitDefs) { - for (const unsigned *ImplicitDefs = II.ImplicitDefs; - *ImplicitDefs; ++ImplicitDefs) - MI->addRegOperand(*ImplicitDefs, true, true); - } - if (II.ImplicitUses) { - for (const unsigned *ImplicitUses = II.ImplicitUses; - *ImplicitUses; ++ImplicitUses) - MI->addRegOperand(*ImplicitUses, false, true); - } + MI->addImplicitDefUseOperands(); // Now that we have emitted all operands, emit this instruction itself. if ((II.Flags & M_USES_CUSTOM_DAG_SCHED_INSERTION) == 0) { |

