diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-10 00:21:30 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-10 00:21:30 +0000 |
commit | c7908037d87c8f6866b872e9f6b5a7fffae5b63e (patch) | |
tree | 694e998bee8258d3058e12b5049363137832429f /include | |
parent | d6397eba2389e8a24d37aa56e049187c1ee75f4f (diff) | |
download | external_llvm-c7908037d87c8f6866b872e9f6b5a7fffae5b63e.zip external_llvm-c7908037d87c8f6866b872e9f6b5a7fffae5b63e.tar.gz external_llvm-c7908037d87c8f6866b872e9f6b5a7fffae5b63e.tar.bz2 |
Reapply r161633-161634 "Partition use lists so defs always come before uses.""
No changes to these patches, MRI needed to be notified when changing
uses into defs and vice versa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineOperand.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 23 |
2 files changed, 15 insertions, 10 deletions
diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h index e04e50a..37d42b3 100644 --- a/include/llvm/CodeGen/MachineOperand.h +++ b/include/llvm/CodeGen/MachineOperand.h @@ -150,7 +150,7 @@ private: struct { // For MO_Register. // Register number is in SmallContents.RegNo. - MachineOperand **Prev; // Access list for register. + MachineOperand *Prev; // Access list for register. See MRI. MachineOperand *Next; } Reg; diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index 0fac1a8..42a8aa4 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -468,10 +468,6 @@ public: const TargetRegisterInfo &TRI, const TargetInstrInfo &TII); -private: - void HandleVRegListReallocation(); - -public: /// defusechain_iterator - This class provides iterator support for machine /// operands in the function that use or define a specific register. If /// ReturnUses is true it returns uses of registers, if ReturnDefs is true it @@ -517,11 +513,20 @@ public: assert(Op && "Cannot increment end iterator!"); Op = getNextOperandForReg(Op); - // If this is an operand we don't care about, skip it. - while (Op && ((!ReturnUses && Op->isUse()) || - (!ReturnDefs && Op->isDef()) || - (SkipDebug && Op->isDebug()))) - Op = getNextOperandForReg(Op); + // All defs come before the uses, so stop def_iterator early. + if (!ReturnUses) { + if (Op) { + if (Op->isUse()) + Op = 0; + else + assert(!Op->isDebug() && "Can't have debug defs"); + } + } else { + // If this is an operand we don't care about, skip it. + while (Op && ((!ReturnDefs && Op->isDef()) || + (SkipDebug && Op->isDebug()))) + Op = getNextOperandForReg(Op); + } return *this; } |