mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
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:
parent
e6afcf8da2
commit
41ce3cfd1b
@ -83,27 +83,20 @@ void MSP430InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
llvm_unreachable("Cannot store this register to stack slot!");
|
||||
}
|
||||
|
||||
bool MSP430InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
const TargetRegisterClass *DestRC,
|
||||
const TargetRegisterClass *SrcRC,
|
||||
DebugLoc DL) const {
|
||||
if (DestRC == SrcRC) {
|
||||
unsigned Opc;
|
||||
if (DestRC == &MSP430::GR16RegClass) {
|
||||
Opc = MSP430::MOV16rr;
|
||||
} else if (DestRC == &MSP430::GR8RegClass) {
|
||||
Opc = MSP430::MOV8rr;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
void MSP430InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I, DebugLoc DL,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
bool KillSrc) const {
|
||||
unsigned Opc;
|
||||
if (MSP430::GR16RegClass.contains(DestReg, SrcReg))
|
||||
Opc = MSP430::MOV16rr;
|
||||
else if (MSP430::GR8RegClass.contains(DestReg, SrcReg))
|
||||
Opc = MSP430::MOV8rr;
|
||||
else
|
||||
llvm_unreachable("Impossible reg-to-reg copy");
|
||||
|
||||
BuildMI(MBB, I, DL, get(Opc), DestReg).addReg(SrcReg);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
BuildMI(MBB, I, DL, get(Opc), DestReg)
|
||||
.addReg(SrcReg, getKillRegState(KillSrc));
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -49,11 +49,10 @@ public:
|
||||
///
|
||||
virtual const TargetRegisterInfo &getRegisterInfo() const { return RI; }
|
||||
|
||||
bool copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
const TargetRegisterClass *DestRC,
|
||||
const TargetRegisterClass *SrcRC,
|
||||
DebugLoc DL) const;
|
||||
void copyPhysReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I, DebugLoc DL,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
bool KillSrc) const;
|
||||
|
||||
bool isMoveInstr(const MachineInstr& MI,
|
||||
unsigned &SrcReg, unsigned &DstReg,
|
||||
|
Loading…
Reference in New Issue
Block a user