[llvm] 1386728 - [AVR] Remove unsigned <= 0 checks. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 04:29:20 PDT 2020


Author: Simon Pilgrim
Date: 2020-05-22T12:28:39+01:00
New Revision: 1386728fc2ff8ea064ef82c2e52d2aa208f71891

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

LOG: [AVR] Remove unsigned <= 0 checks. NFCI.

D77207 changed the bounds checks resulting in tests for positive unsigned values - dropping the superfluous check to fix gcc+Werror "error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]" warning.

Added: 
    

Modified: 
    llvm/lib/Target/AVR/AVRInstrInfo.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AVR/AVRInstrInfo.td b/llvm/lib/Target/AVR/AVRInstrInfo.td
index 5012ddfa7af4..e64f465fac7d 100644
--- a/llvm/lib/Target/AVR/AVRInstrInfo.td
+++ b/llvm/lib/Target/AVR/AVRInstrInfo.td
@@ -128,21 +128,21 @@ def ioaddr8 : PatLeaf<(imm),
 [{
   uint8_t offset = Subtarget->getIORegisterOffset();
   uint64_t val = N->getZExtValue() - offset;
-  return val >= 0x0 && val < 0x40;
+  return val < 0x40;
 }], ioaddr_XFORM>;
 
 def lowioaddr8 : PatLeaf<(imm),
 [{
   uint8_t offset = Subtarget->getIORegisterOffset();
   uint64_t val = N->getZExtValue() - offset;
-  return val >= 0x0 && val < 0x20;
+  return val < 0x20;
 }], ioaddr_XFORM>;
 
 def ioaddr16 : PatLeaf<(imm),
 [{
   uint8_t offset = Subtarget->getIORegisterOffset();
   uint64_t val = N->getZExtValue() - offset;
-  return val >= 0x0 && val < 0x3f;
+  return val < 0x3f;
 }], ioaddr_XFORM>;
 
 def iobitpos8 : PatLeaf<(imm),


        


More information about the llvm-commits mailing list