summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Mips/MipsSEInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsSEInstrInfo.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp b/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
index f31cc3defb4..04c4fdb0b6a 100644
--- a/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
+++ b/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
@@ -211,25 +211,26 @@ static bool isReadOrWritToDSPReg(const MachineInstr &MI, bool &isWrite) {
/// We check for the common case of 'or', as it's MIPS' preferred instruction
/// for GPRs but we have to check the operands to ensure that is the case.
/// Other move instructions for MIPS are directly identifiable.
-bool MipsSEInstrInfo::isCopyInstr(const MachineInstr &MI, MachineOperand &Src,
- MachineOperand &Dest) const {
+bool MipsSEInstrInfo::isCopyInstr(const MachineInstr &MI,
+ const MachineOperand *&Src,
+ const MachineOperand *&Dest) const {
bool isDSPControlWrite = false;
// Condition is made to match the creation of WRDSP/RDDSP copy instruction
// from copyPhysReg function.
if (isReadOrWritToDSPReg(MI, isDSPControlWrite)) {
- if (!MI.getOperand(1).isImm() || !(MI.getOperand(1).getImm() == (1<<4)))
+ if (!MI.getOperand(1).isImm() || MI.getOperand(1).getImm() != (1<<4))
return false;
else if (isDSPControlWrite) {
- Src = MI.getOperand(0);
- Dest = MI.getOperand(2);
+ Src = &MI.getOperand(0);
+ Dest = &MI.getOperand(2);
} else {
- Dest = MI.getOperand(0);
- Src = MI.getOperand(2);
+ Dest = &MI.getOperand(0);
+ Src = &MI.getOperand(2);
}
return true;
} else if (MI.isMoveReg() || isORCopyInst(MI)) {
- Dest = MI.getOperand(0);
- Src = MI.getOperand(1);
+ Dest = &MI.getOperand(0);
+ Src = &MI.getOperand(1);
return true;
}
return false;
OpenPOWER on IntegriCloud