mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
Remove allocatable registers vector. It is already provided by
LiveVariables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5b567516f
commit
1a119e2410
@ -94,8 +94,6 @@ namespace llvm {
|
|||||||
MachineBasicBlock::iterator currentInstr_;
|
MachineBasicBlock::iterator currentInstr_;
|
||||||
LiveVariables* lv_;
|
LiveVariables* lv_;
|
||||||
|
|
||||||
std::vector<bool> allocatableRegisters_;
|
|
||||||
|
|
||||||
typedef std::map<unsigned, MachineBasicBlock*> MbbIndex2MbbMap;
|
typedef std::map<unsigned, MachineBasicBlock*> MbbIndex2MbbMap;
|
||||||
MbbIndex2MbbMap mbbi2mbbMap_;
|
MbbIndex2MbbMap mbbi2mbbMap_;
|
||||||
|
|
||||||
|
@ -94,8 +94,6 @@ namespace llvm {
|
|||||||
MachineBasicBlock::iterator currentInstr_;
|
MachineBasicBlock::iterator currentInstr_;
|
||||||
LiveVariables* lv_;
|
LiveVariables* lv_;
|
||||||
|
|
||||||
std::vector<bool> allocatableRegisters_;
|
|
||||||
|
|
||||||
typedef std::map<unsigned, MachineBasicBlock*> MbbIndex2MbbMap;
|
typedef std::map<unsigned, MachineBasicBlock*> MbbIndex2MbbMap;
|
||||||
MbbIndex2MbbMap mbbi2mbbMap_;
|
MbbIndex2MbbMap mbbi2mbbMap_;
|
||||||
|
|
||||||
|
@ -65,27 +65,12 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
tm_ = &fn.getTarget();
|
tm_ = &fn.getTarget();
|
||||||
mri_ = tm_->getRegisterInfo();
|
mri_ = tm_->getRegisterInfo();
|
||||||
lv_ = &getAnalysis<LiveVariables>();
|
lv_ = &getAnalysis<LiveVariables>();
|
||||||
allocatableRegisters_.clear();
|
|
||||||
mbbi2mbbMap_.clear();
|
mbbi2mbbMap_.clear();
|
||||||
mi2iMap_.clear();
|
mi2iMap_.clear();
|
||||||
r2iMap_.clear();
|
r2iMap_.clear();
|
||||||
r2iMap_.clear();
|
r2iMap_.clear();
|
||||||
intervals_.clear();
|
intervals_.clear();
|
||||||
|
|
||||||
// mark allocatable registers
|
|
||||||
allocatableRegisters_.resize(MRegisterInfo::FirstVirtualRegister);
|
|
||||||
// Loop over all of the register classes...
|
|
||||||
for (MRegisterInfo::regclass_iterator
|
|
||||||
rci = mri_->regclass_begin(), rce = mri_->regclass_end();
|
|
||||||
rci != rce; ++rci) {
|
|
||||||
// Loop over all of the allocatable registers in the function...
|
|
||||||
for (TargetRegisterClass::iterator
|
|
||||||
i = (*rci)->allocation_order_begin(*mf_),
|
|
||||||
e = (*rci)->allocation_order_end(*mf_); i != e; ++i) {
|
|
||||||
allocatableRegisters_[*i] = true; // The reg is allocatable!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// number MachineInstrs
|
// number MachineInstrs
|
||||||
unsigned miIndex = 0;
|
unsigned miIndex = 0;
|
||||||
for (MachineFunction::iterator mbb = mf_->begin(), mbbEnd = mf_->end();
|
for (MachineFunction::iterator mbb = mf_->begin(), mbbEnd = mf_->end();
|
||||||
@ -206,11 +191,7 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb,
|
|||||||
MachineBasicBlock::iterator mi,
|
MachineBasicBlock::iterator mi,
|
||||||
unsigned reg)
|
unsigned reg)
|
||||||
{
|
{
|
||||||
DEBUG(std::cerr << "\t\tregister: ";printRegName(reg); std::cerr << '\n');
|
DEBUG(std::cerr << "\t\tregister: "; printRegName(reg));
|
||||||
if (!lv_->getAllocatablePhysicalRegisters()[reg]) {
|
|
||||||
DEBUG(std::cerr << "\t\t\tnon allocatable register: ignoring\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned start = getInstructionIndex(*mi);
|
unsigned start = getInstructionIndex(*mi);
|
||||||
unsigned end = start;
|
unsigned end = start;
|
||||||
@ -259,7 +240,7 @@ void LiveIntervals::handleRegisterDef(MachineBasicBlock* mbb,
|
|||||||
unsigned reg)
|
unsigned reg)
|
||||||
{
|
{
|
||||||
if (reg < MRegisterInfo::FirstVirtualRegister) {
|
if (reg < MRegisterInfo::FirstVirtualRegister) {
|
||||||
if (allocatableRegisters_[reg]) {
|
if (lv_->getAllocatablePhysicalRegisters()[reg]) {
|
||||||
handlePhysicalRegisterDef(mbb, mi, reg);
|
handlePhysicalRegisterDef(mbb, mi, reg);
|
||||||
for (const unsigned* as = mri_->getAliasSet(reg); *as; ++as)
|
for (const unsigned* as = mri_->getAliasSet(reg); *as; ++as)
|
||||||
handlePhysicalRegisterDef(mbb, mi, *as);
|
handlePhysicalRegisterDef(mbb, mi, *as);
|
||||||
|
@ -94,8 +94,6 @@ namespace llvm {
|
|||||||
MachineBasicBlock::iterator currentInstr_;
|
MachineBasicBlock::iterator currentInstr_;
|
||||||
LiveVariables* lv_;
|
LiveVariables* lv_;
|
||||||
|
|
||||||
std::vector<bool> allocatableRegisters_;
|
|
||||||
|
|
||||||
typedef std::map<unsigned, MachineBasicBlock*> MbbIndex2MbbMap;
|
typedef std::map<unsigned, MachineBasicBlock*> MbbIndex2MbbMap;
|
||||||
MbbIndex2MbbMap mbbi2mbbMap_;
|
MbbIndex2MbbMap mbbi2mbbMap_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user