From 9fe7602862328c0081106709e0a8f03316dc845b Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Mon, 2 Feb 2004 23:08:58 +0000 Subject: [PATCH] Revert changes. Will implement this using a different set of primitives git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11091 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineInstr.h | 3 --- lib/CodeGen/TwoAddressInstructionPass.cpp | 12 +++--------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 8f223b37bf1..670f9721ae8 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -288,9 +288,6 @@ public: bool isHiBits64 () const { return flags & HIFLAG64; } bool isLoBits64 () const { return flags & LOFLAG64; } - MachineOperand& setUse () { flags |= USEFLAG; return *this; } - MachineOperand& setDef () { flags |= DEFFLAG; return *this; } - // used to check if a machine register has been allocated to this operand bool hasAllocatedReg() const { return (regNum >= 0 && diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index ecd22abe311..991be42e531 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -146,17 +146,11 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { LV.addVirtualRegisterDead(regB, &*mbbi, prevMi); // replace all occurences of regB with regA - // and mark all uses and defs of regA as def&use for (unsigned i = 1; i < mi->getNumOperands(); ++i) { - MachineOperand& op = mi->getOperand(i); - if (op.isRegister()) { - if (op.getReg() == regB) - mi->SetMachineOperandReg(i, regA); - if (op.getReg() == regA) - op.setDef().setUse(); - } + if (mi->getOperand(i).isRegister() && + mi->getOperand(i).getReg() == regB) + mi->SetMachineOperandReg(i, regA); } - DEBUG(std::cerr << "\t\tmodified original to: "; mi->print(std::cerr, TM)); assert(mi->getOperand(0).getAllocatedRegNum() ==