diff options
author | Owen Anderson <resistor@mac.com> | 2009-03-13 05:55:11 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-03-13 05:55:11 +0000 |
commit | 49c8aa0d8b2824c70d178c5d55cda64d6613c0d8 (patch) | |
tree | 31ef4e50cfa4efb10053a46a57c64ee2837fc3a2 /lib/CodeGen/RegAllocLinearScan.cpp | |
parent | cee56e7d33fecc74da6f16ebb48dd5b62d73ea8d (diff) |
Convert VirtRegMap to a MachineFunctionPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 8c20a632c9..e8296a7477 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -105,7 +105,7 @@ namespace { greater_ptr<LiveInterval> > IntervalHeap; IntervalHeap unhandled_; std::auto_ptr<PhysRegTracker> prt_; - std::auto_ptr<VirtRegMap> vrm_; + VirtRegMap* vrm_; std::auto_ptr<Spiller> spiller_; public: @@ -126,6 +126,8 @@ namespace { AU.addPreserved<LiveStacks>(); AU.addRequired<MachineLoopInfo>(); AU.addPreserved<MachineLoopInfo>(); + AU.addRequired<VirtRegMap>(); + AU.addPreserved<VirtRegMap>(); AU.addPreservedID(MachineDominatorsID); MachineFunctionPass::getAnalysisUsage(AU); } @@ -305,7 +307,7 @@ bool RALinScan::runOnMachineFunction(MachineFunction &fn) { ComputeRelatedRegClasses(); if (!prt_.get()) prt_.reset(new PhysRegTracker(*tri_)); - vrm_.reset(new VirtRegMap(*mf_)); + vrm_ = &getAnalysis<VirtRegMap>(); if (!spiller_.get()) spiller_.reset(createSpiller()); initIntervalSets(); @@ -314,7 +316,6 @@ bool RALinScan::runOnMachineFunction(MachineFunction &fn) { // Rewrite spill code and update the PhysRegsUsed set. spiller_->runOnMachineFunction(*mf_, *vrm_); - vrm_.reset(); // Free the VirtRegMap assert(unhandled_.empty() && "Unhandled live intervals remain!"); fixed_.clear(); |