mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -191,7 +191,7 @@ static unsigned getUnindexedOpcode(unsigned Opc) {
|
||||
MachineInstr *
|
||||
ARMInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
|
||||
MachineBasicBlock::iterator &MBBI,
|
||||
LiveVariables &LV) const {
|
||||
LiveVariables *LV) const {
|
||||
if (!EnableARM3Addr)
|
||||
return NULL;
|
||||
|
||||
@@ -300,22 +300,25 @@ ARMInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
|
||||
if (MO.isRegister() && MO.getReg() &&
|
||||
TargetRegisterInfo::isVirtualRegister(MO.getReg())) {
|
||||
unsigned Reg = MO.getReg();
|
||||
LiveVariables::VarInfo &VI = LV.getVarInfo(Reg);
|
||||
if (MO.isDef()) {
|
||||
MachineInstr *NewMI = (Reg == WBReg) ? UpdateMI : MemMI;
|
||||
if (MO.isDead())
|
||||
LV.addVirtualRegisterDead(Reg, NewMI);
|
||||
}
|
||||
if (MO.isUse() && MO.isKill()) {
|
||||
for (unsigned j = 0; j < 2; ++j) {
|
||||
// Look at the two new MI's in reverse order.
|
||||
MachineInstr *NewMI = NewMIs[j];
|
||||
if (!NewMI->readsRegister(Reg))
|
||||
continue;
|
||||
LV.addVirtualRegisterKilled(Reg, NewMI);
|
||||
if (VI.removeKill(MI))
|
||||
VI.Kills.push_back(NewMI);
|
||||
break;
|
||||
|
||||
if (LV) {
|
||||
LiveVariables::VarInfo &VI = LV->getVarInfo(Reg);
|
||||
if (MO.isDef()) {
|
||||
MachineInstr *NewMI = (Reg == WBReg) ? UpdateMI : MemMI;
|
||||
if (MO.isDead())
|
||||
LV->addVirtualRegisterDead(Reg, NewMI);
|
||||
}
|
||||
if (MO.isUse() && MO.isKill()) {
|
||||
for (unsigned j = 0; j < 2; ++j) {
|
||||
// Look at the two new MI's in reverse order.
|
||||
MachineInstr *NewMI = NewMIs[j];
|
||||
if (!NewMI->readsRegister(Reg))
|
||||
continue;
|
||||
LV->addVirtualRegisterKilled(Reg, NewMI);
|
||||
if (VI.removeKill(MI))
|
||||
VI.Kills.push_back(NewMI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user