Replace copyRegToReg with copyPhysReg for MSP430.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2010-07-11 06:53:30 +00:00
parent e6afcf8da2
commit 41ce3cfd1b
2 changed files with 17 additions and 25 deletions

View File

@ -83,27 +83,20 @@ void MSP430InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
llvm_unreachable("Cannot store this register to stack slot!"); llvm_unreachable("Cannot store this register to stack slot!");
} }
bool MSP430InstrInfo::copyRegToReg(MachineBasicBlock &MBB, void MSP430InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I, MachineBasicBlock::iterator I, DebugLoc DL,
unsigned DestReg, unsigned SrcReg, unsigned DestReg, unsigned SrcReg,
const TargetRegisterClass *DestRC, bool KillSrc) const {
const TargetRegisterClass *SrcRC, unsigned Opc;
DebugLoc DL) const { if (MSP430::GR16RegClass.contains(DestReg, SrcReg))
if (DestRC == SrcRC) { Opc = MSP430::MOV16rr;
unsigned Opc; else if (MSP430::GR8RegClass.contains(DestReg, SrcReg))
if (DestRC == &MSP430::GR16RegClass) { Opc = MSP430::MOV8rr;
Opc = MSP430::MOV16rr; else
} else if (DestRC == &MSP430::GR8RegClass) { llvm_unreachable("Impossible reg-to-reg copy");
Opc = MSP430::MOV8rr;
} else {
return false;
}
BuildMI(MBB, I, DL, get(Opc), DestReg).addReg(SrcReg); BuildMI(MBB, I, DL, get(Opc), DestReg)
return true; .addReg(SrcReg, getKillRegState(KillSrc));
}
return false;
} }
bool bool

View File

@ -49,11 +49,10 @@ public:
/// ///
virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; } virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
bool copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, void copyPhysReg(MachineBasicBlock &MBB,
unsigned DestReg, unsigned SrcReg, MachineBasicBlock::iterator I, DebugLoc DL,
const TargetRegisterClass *DestRC, unsigned DestReg, unsigned SrcReg,
const TargetRegisterClass *SrcRC, bool KillSrc) const;
DebugLoc DL) const;
bool isMoveInstr(const MachineInstr& MI, bool isMoveInstr(const MachineInstr& MI,
unsigned &SrcReg, unsigned &DstReg, unsigned &SrcReg, unsigned &DstReg,