llvm-project
209ff8bf - MIPS: Fix unsigned compare with zero in MipsSEInstrInfo::copyPhysReg (#179866)

Commit
6 days ago
MIPS: Fix unsigned compare with zero in MipsSEInstrInfo::copyPhysReg (#179866) SrcRegOff >= 0 is not needed at all for unsigned. This fixes the warning: ``` llvm/lib/Target/Mips/MipsSEInstrInfo.cpp: In member function ‘virtual void llvm::MipsSEInstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, const llvm::DebugLoc&, llvm::Register, llvm::Register, bool, bool, bool) const’: llvm/lib/Target/Mips/MipsSEInstrInfo.cpp:245:48: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] 245 | if (SrcRegOff == DestRegOff && SrcRegOff >= 0 && SrcRegOff <= 31) | ~~~~~~~~~~^~~~ llvm/lib/Target/Mips/MipsSEInstrInfo.cpp:256:48: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] 256 | if (SrcRegOff == DestRegOff && SrcRegOff >= 0 && SrcRegOff <= 31) ```
Author
Parents
Loading