diff options
| author | Jim Grosbach <grosbach@apple.com> | 2010-09-01 21:23:03 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2010-09-01 21:23:03 +0000 |
| commit | b070ddf6b41f4342d6c5ed31ff92f64771e9a961 (patch) | |
| tree | a19d37b705e3700639cd86bfd64c677a4522a9c0 /llvm/lib/CodeGen/RegAllocPBQP.cpp | |
| parent | 5ccf18c2fc5017242ed625479541e316d295a5c0 (diff) | |
| download | bcm5719-llvm-b070ddf6b41f4342d6c5ed31ff92f64771e9a961.tar.gz bcm5719-llvm-b070ddf6b41f4342d6c5ed31ff92f64771e9a961.zip | |
The register allocator shouldn't consider allocating reserved registers. PBQP version.
llvm-svn: 112742
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocPBQP.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocPBQP.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp index 0dd92148269..c6fdf04c7af 100644 --- a/llvm/lib/CodeGen/RegAllocPBQP.cpp +++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp @@ -587,6 +587,8 @@ PBQP::Graph PBQPRegAlloc::constructPBQPProblem() { // Resize allowedSets container appropriately. allowedSets.resize(vregIntervalsToAlloc.size()); + BitVector ReservedRegs = tri->getReservedRegs(*mf); + // Iterate over virtual register intervals to compute allowed sets... for (unsigned node = 0; node < node2LI.size(); ++node) { @@ -595,8 +597,12 @@ PBQP::Graph PBQPRegAlloc::constructPBQPProblem() { const TargetRegisterClass *liRC = mri->getRegClass(li->reg); // Start by assuming all allocable registers in the class are allowed... - RegVector liAllowed(liRC->allocation_order_begin(*mf), - liRC->allocation_order_end(*mf)); + RegVector liAllowed; + TargetRegisterClass::iterator aob = liRC->allocation_order_begin(*mf); + TargetRegisterClass::iterator aoe = liRC->allocation_order_end(*mf); + for (TargetRegisterClass::iterator it = aob; it != aoe; ++it) + if (!ReservedRegs.test(*it)) + liAllowed.push_back(*it); // Eliminate the physical registers which overlap with this range, along // with all their aliases. |

