diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-07 01:56:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-07 01:56:04 +0000 |
commit | 69244300b8a0112efb44b6273ecea4ca6264b8cf (patch) | |
tree | b5a0565e968d692bfa45952fe63009ff1b2be001 /lib/CodeGen/MachineInstr.cpp | |
parent | 6425f8be7263e625c2d7484eb2fb8f6643824f49 (diff) |
Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.
Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around. Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.
Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 00be1f1f75..40ab4c2dd9 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -288,7 +288,7 @@ MachineInstr::MachineInstr(MachineBasicBlock *MBB, /// MachineInstr ctor - Copies MachineInstr arg exactly /// MachineInstr::MachineInstr(const MachineInstr &MI) { - TID = MI.getInstrDescriptor(); + TID = MI.getDesc(); NumImplicitOps = MI.NumImplicitOps; Operands.reserve(MI.getNumOperands()); @@ -538,8 +538,8 @@ MachineOperand *MachineInstr::findRegisterDefOperand(unsigned Reg) { /// operand list that is used to represent the predicate. It returns -1 if /// none is found. int MachineInstr::findFirstPredOperandIdx() const { - const TargetInstrDescriptor *TID = getInstrDescriptor(); - if (TID->Flags & M_PREDICABLE) { + const TargetInstrDescriptor *TID = getDesc(); + if (TID->isPredicable()) { for (unsigned i = 0, e = getNumOperands(); i != e; ++i) if ((TID->OpInfo[i].Flags & M_PREDICATE_OPERAND)) return i; @@ -551,7 +551,7 @@ int MachineInstr::findFirstPredOperandIdx() const { /// isRegReDefinedByTwoAddr - Returns true if the Reg re-definition is due /// to two addr elimination. bool MachineInstr::isRegReDefinedByTwoAddr(unsigned Reg) const { - const TargetInstrDescriptor *TID = getInstrDescriptor(); + const TargetInstrDescriptor *TID = getDesc(); for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { const MachineOperand &MO1 = getOperand(i); if (MO1.isRegister() && MO1.isDef() && MO1.getReg() == Reg) { @@ -588,8 +588,8 @@ void MachineInstr::copyKillDeadInfo(const MachineInstr *MI) { /// copyPredicates - Copies predicate operand(s) from MI. void MachineInstr::copyPredicates(const MachineInstr *MI) { - const TargetInstrDescriptor *TID = MI->getInstrDescriptor(); - if (TID->Flags & M_PREDICABLE) { + const TargetInstrDescriptor *TID = MI->getDesc(); + if (TID->isPredicable()) { for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { if ((TID->OpInfo[i].Flags & M_PREDICATE_OPERAND)) { // Predicated operands must be last operands. @@ -612,7 +612,7 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const { ++StartOp; // Don't print this operand again! } - OS << getInstrDescriptor()->Name; + OS << getDesc()->Name; for (unsigned i = StartOp, e = getNumOperands(); i != e; ++i) { if (i != StartOp) |