mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[Mips] Silencing warnings in instruction info (NFC)
isORCopyInst and isReadOrWriteToDSPReg functions were producing warning that some statements my fall through. Patch by Nikola Prica. Differential Revision: https://reviews.llvm.org/D47876 llvm-svn: 334194
This commit is contained in:
parent
2daa6b3f4d
commit
dca3ba34fb
@ -181,31 +181,37 @@ void MipsSEInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
|
|||||||
|
|
||||||
static bool isORCopyInst(const MachineInstr &MI) {
|
static bool isORCopyInst(const MachineInstr &MI) {
|
||||||
switch (MI.getOpcode()) {
|
switch (MI.getOpcode()) {
|
||||||
|
default:
|
||||||
|
break;
|
||||||
case Mips::OR_MM:
|
case Mips::OR_MM:
|
||||||
case Mips::OR:
|
case Mips::OR:
|
||||||
if (MI.getOperand(2).getReg() == Mips::ZERO)
|
if (MI.getOperand(2).getReg() == Mips::ZERO)
|
||||||
return true;
|
return true;
|
||||||
|
break;
|
||||||
case Mips::OR64:
|
case Mips::OR64:
|
||||||
if (MI.getOperand(2).getReg() == Mips::ZERO_64)
|
if (MI.getOperand(2).getReg() == Mips::ZERO_64)
|
||||||
return true;
|
return true;
|
||||||
default:
|
break;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If @MI is WRDSP/RRDSP instruction return true with @isWrite set to true
|
/// If @MI is WRDSP/RRDSP instruction return true with @isWrite set to true
|
||||||
/// if it is WRDSP instruction.
|
/// if it is WRDSP instruction.
|
||||||
static bool isReadOrWritToDSPReg(const MachineInstr &MI, bool &isWrite) {
|
static bool isReadOrWriteToDSPReg(const MachineInstr &MI, bool &isWrite) {
|
||||||
switch (MI.getOpcode()) {
|
switch (MI.getOpcode()) {
|
||||||
case Mips::WRDSP:
|
default:
|
||||||
case Mips::WRDSP_MM:
|
return false;
|
||||||
isWrite = true;
|
case Mips::WRDSP:
|
||||||
case Mips::RDDSP:
|
case Mips::WRDSP_MM:
|
||||||
case Mips::RDDSP_MM:
|
isWrite = true;
|
||||||
return true;
|
break;
|
||||||
default:
|
case Mips::RDDSP:
|
||||||
return false;
|
case Mips::RDDSP_MM:
|
||||||
|
isWrite = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// We check for the common case of 'or', as it's MIPS' preferred instruction
|
/// We check for the common case of 'or', as it's MIPS' preferred instruction
|
||||||
@ -217,7 +223,7 @@ bool MipsSEInstrInfo::isCopyInstr(const MachineInstr &MI,
|
|||||||
bool isDSPControlWrite = false;
|
bool isDSPControlWrite = false;
|
||||||
// Condition is made to match the creation of WRDSP/RDDSP copy instruction
|
// Condition is made to match the creation of WRDSP/RDDSP copy instruction
|
||||||
// from copyPhysReg function.
|
// from copyPhysReg function.
|
||||||
if (isReadOrWritToDSPReg(MI, isDSPControlWrite)) {
|
if (isReadOrWriteToDSPReg(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;
|
return false;
|
||||||
else if (isDSPControlWrite) {
|
else if (isDSPControlWrite) {
|
||||||
|
Loading…
Reference in New Issue
Block a user