summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineRegisterInfo.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-11 20:30:28 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-11 20:30:28 +0000
commit82b07dc4995d48065bd95affff4d8513a5cad4f2 (patch)
tree6b6af716b38928b7be1e04fa7e0dceb3c1903251 /lib/CodeGen/MachineRegisterInfo.cpp
parentd42718080f1f140726220563d741261fd7f661c5 (diff)
downloadllvm-82b07dc4995d48065bd95affff4d8513a5cad4f2.tar.gz
llvm-82b07dc4995d48065bd95affff4d8513a5cad4f2.tar.bz2
llvm-82b07dc4995d48065bd95affff4d8513a5cad4f2.tar.xz
Simplify the tracking of used physregs to a bulk bitor followed by a transitive
closure after allocating all blocks. Add a few more test cases for -regalloc=fast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r--lib/CodeGen/MachineRegisterInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineRegisterInfo.cpp b/lib/CodeGen/MachineRegisterInfo.cpp
index ef794d5ae3..4a150435ce 100644
--- a/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/lib/CodeGen/MachineRegisterInfo.cpp
@@ -267,6 +267,15 @@ MachineRegisterInfo::EmitLiveInCopies(MachineBasicBlock *EntryMBB,
EntryMBB->addLiveIn(I->first);
}
+void MachineRegisterInfo::closePhysRegsUsed(const TargetRegisterInfo &TRI) {
+ for (int i = UsedPhysRegs.find_first(); i >= 0;
+ i = UsedPhysRegs.find_next(i))
+ for (const unsigned *SS = TRI.getSubRegisters(i);
+ unsigned SubReg = *SS; ++SS)
+ if (SubReg > i)
+ UsedPhysRegs.set(SubReg);
+}
+
#ifndef NDEBUG
void MachineRegisterInfo::dumpUses(unsigned Reg) const {
for (use_iterator I = use_begin(Reg), E = use_end(); I != E; ++I)