mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Use newly added API in MRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16060 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bb4bdf4fe4
commit
5327801fb8
@ -47,6 +47,8 @@ namespace llvm {
|
||||
typedef std::map<unsigned, unsigned> Reg2RegMap;
|
||||
Reg2RegMap r2rMap_;
|
||||
|
||||
std::vector<bool> allocatableRegs_;
|
||||
|
||||
public:
|
||||
struct InstrSlots
|
||||
{
|
||||
|
@ -87,6 +87,7 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
|
||||
tm_ = &fn.getTarget();
|
||||
mri_ = tm_->getRegisterInfo();
|
||||
lv_ = &getAnalysis<LiveVariables>();
|
||||
allocatableRegs_ = mri_->getAllocatableSet(fn);
|
||||
|
||||
// number MachineInstrs
|
||||
unsigned miIndex = 0;
|
||||
@ -484,7 +485,7 @@ void LiveIntervals::handleRegisterDef(MachineBasicBlock *MBB,
|
||||
unsigned reg) {
|
||||
if (MRegisterInfo::isVirtualRegister(reg))
|
||||
handleVirtualRegisterDef(MBB, MI, getOrCreateInterval(reg));
|
||||
else if (lv_->getAllocatablePhysicalRegisters()[reg]) {
|
||||
else if (allocatableRegs_[reg]) {
|
||||
handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(reg));
|
||||
for (const unsigned* AS = mri_->getAliasSet(reg); *AS; ++AS)
|
||||
handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(*AS));
|
||||
@ -541,10 +542,8 @@ void LiveIntervals::joinIntervalsInMachineBB(MachineBasicBlock *MBB) {
|
||||
// on not allocatable physical registers
|
||||
unsigned regA, regB;
|
||||
if (TII.isMoveInstr(*mi, regA, regB) &&
|
||||
(MRegisterInfo::isVirtualRegister(regA) ||
|
||||
lv_->getAllocatablePhysicalRegisters()[regA]) &&
|
||||
(MRegisterInfo::isVirtualRegister(regB) ||
|
||||
lv_->getAllocatablePhysicalRegisters()[regB])) {
|
||||
(MRegisterInfo::isVirtualRegister(regA) || allocatableRegs_[regA]) &&
|
||||
(MRegisterInfo::isVirtualRegister(regB) || allocatableRegs_[regB])) {
|
||||
|
||||
// Get representative registers.
|
||||
regA = rep(regA);
|
||||
|
@ -47,6 +47,8 @@ namespace llvm {
|
||||
typedef std::map<unsigned, unsigned> Reg2RegMap;
|
||||
Reg2RegMap r2rMap_;
|
||||
|
||||
std::vector<bool> allocatableRegs_;
|
||||
|
||||
public:
|
||||
struct InstrSlots
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user