[llvm] 2e54b4f - [ARM] Silence signed comparison warning. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 31 06:22:54 PDT 2025


Author: David Green
Date: 2025-03-31T13:59:58+01:00
New Revision: 2e54b4f9ea3fb7e83b5fc5fe19235ea82f0d4549

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

LOG: [ARM] Silence signed comparison warning. NFC

After f4ec179bf5295f92aa0346392a58fad54f9b458e, AbsImm is no longer signed and cannot be < 0.

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index d2f9ec982ae01..a4713311e2b3e 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -19696,7 +19696,7 @@ bool ARMTargetLowering::isLegalAddImmediate(int64_t Imm) const {
   if (Subtarget->isThumb2())
     return ARM_AM::getT2SOImmVal(AbsImm) != -1;
   // Thumb1 only has 8-bit unsigned immediate.
-  return AbsImm >= 0 && AbsImm <= 255;
+  return AbsImm <= 255;
 }
 
 // Return false to prevent folding


        


More information about the llvm-commits mailing list