diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-23 22:45:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-23 22:45:13 +0000 |
commit | b0f31bf19b9cd0107900728123d4848eae462e6c (patch) | |
tree | f29cc2a0f3ce60a0c643f835852678b5aaad643e /lib/CodeGen/RegAllocIterativeScan.cpp | |
parent | ce9c41e77a2ec75d48a173b9baf0f4a3bf49fac7 (diff) |
Update these register allocators to set the PhysRegUsed info in MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocIterativeScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocIterativeScan.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocIterativeScan.cpp b/lib/CodeGen/RegAllocIterativeScan.cpp index ddbb52a880..0ebef5ef64 100644 --- a/lib/CodeGen/RegAllocIterativeScan.cpp +++ b/lib/CodeGen/RegAllocIterativeScan.cpp @@ -51,6 +51,7 @@ namespace { const TargetMachine* tm_; const MRegisterInfo* mri_; LiveIntervals* li_; + bool *PhysRegsUsed; typedef std::vector<LiveInterval*> IntervalPtrs; IntervalPtrs unhandled_, fixed_, active_, inactive_, handled_, spilled_; @@ -145,6 +146,11 @@ bool RA::runOnMachineFunction(MachineFunction &fn) { tm_ = &fn.getTarget(); mri_ = tm_->getRegisterInfo(); li_ = &getAnalysis<LiveIntervals>(); + + PhysRegsUsed = new bool[mri_->getNumRegs()]; + std::fill(PhysRegsUsed, PhysRegsUsed+mri_->getNumRegs(), false); + fn.setUsedPhysRegs(PhysRegsUsed); + if (!prt_.get()) prt_.reset(new PhysRegTracker(*mri_)); vrm_.reset(new VirtRegMap(*mf_)); if (!spiller_.get()) spiller_.reset(createSpiller()); @@ -256,8 +262,10 @@ void RA::initIntervalSets() { for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i){ unhandled_.push_back(&i->second); - if (MRegisterInfo::isPhysicalRegister(i->second.reg)) + if (MRegisterInfo::isPhysicalRegister(i->second.reg)) { + PhysRegsUsed[i->second.reg] = true; fixed_.push_back(&i->second); + } } } |