mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
The register allocator shouldn't consider allocating reserved registers. PBQP version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112742 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
067a648599
commit
269354e570
@ -587,6 +587,8 @@ PBQP::Graph PBQPRegAlloc::constructPBQPProblem() {
|
|||||||
// Resize allowedSets container appropriately.
|
// Resize allowedSets container appropriately.
|
||||||
allowedSets.resize(vregIntervalsToAlloc.size());
|
allowedSets.resize(vregIntervalsToAlloc.size());
|
||||||
|
|
||||||
|
BitVector ReservedRegs = tri->getReservedRegs(*mf);
|
||||||
|
|
||||||
// Iterate over virtual register intervals to compute allowed sets...
|
// Iterate over virtual register intervals to compute allowed sets...
|
||||||
for (unsigned node = 0; node < node2LI.size(); ++node) {
|
for (unsigned node = 0; node < node2LI.size(); ++node) {
|
||||||
|
|
||||||
@ -595,8 +597,12 @@ PBQP::Graph PBQPRegAlloc::constructPBQPProblem() {
|
|||||||
const TargetRegisterClass *liRC = mri->getRegClass(li->reg);
|
const TargetRegisterClass *liRC = mri->getRegClass(li->reg);
|
||||||
|
|
||||||
// Start by assuming all allocable registers in the class are allowed...
|
// Start by assuming all allocable registers in the class are allowed...
|
||||||
RegVector liAllowed(liRC->allocation_order_begin(*mf),
|
RegVector liAllowed;
|
||||||
liRC->allocation_order_end(*mf));
|
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
|
// Eliminate the physical registers which overlap with this range, along
|
||||||
// with all their aliases.
|
// with all their aliases.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user