Modify the two address instruction pass to remove the duplicate

operand of the instruction and thus simplify the register allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos
2004-02-04 22:17:40 +00:00
parent a33ceaa2d4
commit 14be64018f
11 changed files with 227 additions and 232 deletions

View File

@ -27,24 +27,6 @@ namespace llvm {
//
extern const TargetInstrDescriptor *TargetInstrDescriptors;
bool MachineOperand::isEverUsed(const MachineInstr& mi) const
{
for (int i = 0, e = mi.getNumOperands(); i != e; ++i) {
if (*this == mi.getOperand(i) && mi.getOperand(i).isUse())
return true;
}
return false;
}
bool MachineOperand::isEverDefined(const MachineInstr& mi) const
{
for (int i = 0, e = mi.getNumOperands(); i != e; ++i) {
if (*this == mi.getOperand(i) && mi.getOperand(i).isDef())
return true;
}
return false;
}
// Constructor for instructions with variable #operands
MachineInstr::MachineInstr(MachineOpCode OpCode, unsigned numOperands)
: opCode(OpCode),