diff options
author | Chris Lattner <sabre@nondot.org> | 2006-02-23 06:44:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-02-23 06:44:17 +0000 |
commit | ffab42263ae3436229e5aeb1414e1a788c1d7378 (patch) | |
tree | 2474f93dc95349887d142b448da214ecf91d58a4 /lib/CodeGen/RegAllocLinearScan.cpp | |
parent | e650a6b3f41456318bf3b7b8fc2e8d29e23d1c04 (diff) |
Code cleanups, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index f5b081ab59..252fcfc2e8 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -651,26 +651,17 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur) IntervalPtrs::iterator it; if ((it = FindIntervalInVector(active_, i)) != active_.end()) { active_.erase(it); - if (MRegisterInfo::isPhysicalRegister(i->reg)) { - assert(0 && "daksjlfd"); - prt_->delRegUse(i->reg); + assert(!MRegisterInfo::isPhysicalRegister(i->reg)); + if (!spilled.count(i->reg)) unhandled_.push(i); - } else { - if (!spilled.count(i->reg)) - unhandled_.push(i); - prt_->delRegUse(vrm_->getPhys(i->reg)); - vrm_->clearVirt(i->reg); - } + prt_->delRegUse(vrm_->getPhys(i->reg)); + vrm_->clearVirt(i->reg); } else if ((it = FindIntervalInVector(inactive_, i)) != inactive_.end()) { inactive_.erase(it); - if (MRegisterInfo::isPhysicalRegister(i->reg)) { - assert(0 && "daksjlfd"); + assert(!MRegisterInfo::isPhysicalRegister(i->reg)); + if (!spilled.count(i->reg)) unhandled_.push(i); - } else { - if (!spilled.count(i->reg)) - unhandled_.push(i); - vrm_->clearVirt(i->reg); - } + vrm_->clearVirt(i->reg); } else { assert(MRegisterInfo::isVirtualRegister(i->reg) && "Can only allocate virtual registers!"); @@ -694,11 +685,8 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur) HI->expiredAt(cur->beginNumber())) { DEBUG(std::cerr << "\t\t\tundo changes for: " << *HI << '\n'); active_.push_back(std::make_pair(HI, HI->begin())); - if (MRegisterInfo::isPhysicalRegister(HI->reg)) { - assert(0 &&"sdflkajsdf"); - prt_->addRegUse(HI->reg); - } else - prt_->addRegUse(vrm_->getPhys(HI->reg)); + assert(!MRegisterInfo::isPhysicalRegister(HI->reg)); + prt_->addRegUse(vrm_->getPhys(HI->reg)); } } @@ -709,8 +697,7 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur) /// getFreePhysReg - return a free physical register for this virtual register /// interval if we have one, otherwise return 0. -unsigned RA::getFreePhysReg(LiveInterval* cur) -{ +unsigned RA::getFreePhysReg(LiveInterval *cur) { std::vector<unsigned> inactiveCounts(mri_->getNumRegs(), 0); unsigned MaxInactiveCount = 0; |