1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Use newly added API in MRegisterInfo.

llvm-svn: 16060
This commit is contained in:
Alkis Evlogimenos 2004-08-26 22:22:38 +00:00
parent 100c89e9ea
commit 3bfc6999f2
2 changed files with 6 additions and 5 deletions

View File

@ -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);

View File

@ -47,6 +47,8 @@ namespace llvm {
typedef std::map<unsigned, unsigned> Reg2RegMap;
Reg2RegMap r2rMap_;
std::vector<bool> allocatableRegs_;
public:
struct InstrSlots
{