[llvm] ceaaa2b - [AMDGPU] Fix warnings

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 20:24:36 PST 2025


Author: Kazu Hirata
Date: 2025-01-21T20:24:30-08:00
New Revision: ceaaa2b9ae3487f7ba0de553b1876e581fdbd0eb

URL: https://github.com/llvm/llvm-project/commit/ceaaa2b9ae3487f7ba0de553b1876e581fdbd0eb
DIFF: https://github.com/llvm/llvm-project/commit/ceaaa2b9ae3487f7ba0de553b1876e581fdbd0eb.diff

LOG: [AMDGPU] Fix warnings

This patch fixes:

  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:2792:14: error: comparison of
  integers of different signs: 'unsigned int' and 'int'
  [-Werror,-Wsign-compare]

  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:2797:14: error: comparison of
  integers of different signs: 'unsigned int' and 'int'
  [-Werror,-Wsign-compare]

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 5c20f28b3d9de2..8860fe14e56532 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -2789,12 +2789,12 @@ bool SIInstrInfo::isLegalToSwap(const MachineInstr &MI, unsigned OpIdx0,
       return false;
   }
 
-  if (OpIdx1 != Src0Idx && MO0->isReg()) {
+  if ((int)OpIdx1 != Src0Idx && MO0->isReg()) {
     if (!DefinedRC1)
       return OpInfo1.OperandType == MCOI::OPERAND_UNKNOWN;
     return isLegalRegOperand(MI, OpIdx1, *MO0);
   }
-  if (OpIdx0 != Src0Idx && MO1->isReg()) {
+  if ((int)OpIdx0 != Src0Idx && MO1->isReg()) {
     if (!DefinedRC0)
       return OpInfo0.OperandType == MCOI::OPERAND_UNKNOWN;
     return isLegalRegOperand(MI, OpIdx0, *MO1);


        


More information about the llvm-commits mailing list