mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
* Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves llvm-svn: 15242
This commit is contained in:
parent
87d624622f
commit
73687cfcc6
@ -26,7 +26,7 @@ bool PowerPCInstrInfo::isMoveInstr(const MachineInstr& MI,
|
||||
unsigned& sourceReg,
|
||||
unsigned& destReg) const {
|
||||
MachineOpCode oc = MI.getOpcode();
|
||||
if (oc == PPC32::OR) {
|
||||
if (oc == PPC32::OR) { // or r1, r2, r2
|
||||
assert(MI.getNumOperands() == 3 &&
|
||||
MI.getOperand(0).isRegister() &&
|
||||
MI.getOperand(1).isRegister() &&
|
||||
@ -37,7 +37,17 @@ bool PowerPCInstrInfo::isMoveInstr(const MachineInstr& MI,
|
||||
destReg = MI.getOperand(0).getReg();
|
||||
return true;
|
||||
}
|
||||
} else if (oc == PPC32::FMR) {
|
||||
} else if (oc == PPC32::ADDI) { // addi r1, r2, 0
|
||||
if (MI.getNumOperands() == 3 &&
|
||||
MI.getOperand(0).isRegister() &&
|
||||
MI.getOperand(1).isRegister() &&
|
||||
MI.getOperand(2).isImmediate() &&
|
||||
MI.getOperand(2).getImmedValue() == 0) {
|
||||
sourceReg = MI.getOperand(1).getReg();
|
||||
destReg = MI.getOperand(0).getReg();
|
||||
return true;
|
||||
}
|
||||
} else if (oc == PPC32::FMR) { // fmr r1, r2
|
||||
assert(MI.getNumOperands() == 2 &&
|
||||
MI.getOperand(0).isRegister() &&
|
||||
MI.getOperand(1).isRegister() &&
|
||||
|
Loading…
Reference in New Issue
Block a user