mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Move two methods out of line, make them work when the record for a machine
instruction includes physregs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1c57be4a40
commit
7a3abdc63c
@ -242,19 +242,8 @@ public:
|
||||
|
||||
/// removeVirtualRegistersKilled - Remove all killed info for the specified
|
||||
/// instruction.
|
||||
void removeVirtualRegistersKilled(MachineInstr *MI) {
|
||||
std::map<MachineInstr*, std::vector<unsigned> >::iterator I =
|
||||
RegistersKilled.find(MI);
|
||||
if (I != RegistersKilled.end()) {
|
||||
std::vector<unsigned> &Regs = I->second;
|
||||
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
||||
bool removed = getVarInfo(Regs[i]).removeKill(MI);
|
||||
assert(removed && "kill not in register's VarInfo?");
|
||||
}
|
||||
RegistersKilled.erase(I);
|
||||
}
|
||||
}
|
||||
|
||||
void removeVirtualRegistersKilled(MachineInstr *MI);
|
||||
|
||||
/// addVirtualRegisterDead - Add information about the fact that the specified
|
||||
/// register is dead after being used by the specified instruction.
|
||||
///
|
||||
@ -292,21 +281,10 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
/// removeVirtualRegistersDead - Remove all of the specified dead
|
||||
/// registers from the live variable information.
|
||||
void removeVirtualRegistersDead(MachineInstr *MI) {
|
||||
std::map<MachineInstr*, std::vector<unsigned> >::iterator I =
|
||||
RegistersDead.find(MI);
|
||||
if (I != RegistersDead.end()) {
|
||||
std::vector<unsigned> &Regs = I->second;
|
||||
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
||||
bool removed = getVarInfo(Regs[i]).removeKill(MI);
|
||||
assert(removed && "kill not in register's VarInfo?");
|
||||
}
|
||||
RegistersDead.erase(I);
|
||||
}
|
||||
}
|
||||
|
||||
/// removeVirtualRegistersDead - Remove all of the dead registers for the
|
||||
/// specified instruction from the live variable information.
|
||||
void removeVirtualRegistersDead(MachineInstr *MI);
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesAll();
|
||||
}
|
||||
|
@ -415,3 +415,39 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI,
|
||||
RegistersDead.erase(OldMI);
|
||||
}
|
||||
}
|
||||
|
||||
/// removeVirtualRegistersKilled - Remove all killed info for the specified
|
||||
/// instruction.
|
||||
void LiveVariables::removeVirtualRegistersKilled(MachineInstr *MI) {
|
||||
std::map<MachineInstr*, std::vector<unsigned> >::iterator I =
|
||||
RegistersKilled.find(MI);
|
||||
if (I == RegistersKilled.end()) return;
|
||||
|
||||
std::vector<unsigned> &Regs = I->second;
|
||||
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
||||
if (MRegisterInfo::isVirtualRegister(Regs[i])) {
|
||||
bool removed = getVarInfo(Regs[i]).removeKill(MI);
|
||||
assert(removed && "kill not in register's VarInfo?");
|
||||
}
|
||||
}
|
||||
RegistersKilled.erase(I);
|
||||
}
|
||||
|
||||
/// removeVirtualRegistersDead - Remove all of the dead registers for the
|
||||
/// specified instruction from the live variable information.
|
||||
void LiveVariables::removeVirtualRegistersDead(MachineInstr *MI) {
|
||||
std::map<MachineInstr*, std::vector<unsigned> >::iterator I =
|
||||
RegistersDead.find(MI);
|
||||
if (I == RegistersDead.end()) return;
|
||||
|
||||
std::vector<unsigned> &Regs = I->second;
|
||||
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
|
||||
if (MRegisterInfo::isVirtualRegister(Regs[i])) {
|
||||
bool removed = getVarInfo(Regs[i]).removeKill(MI);
|
||||
assert(removed && "kill not in register's VarInfo?");
|
||||
}
|
||||
}
|
||||
RegistersDead.erase(I);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user