[llvm] 44478ba - Fix MSVC signed/unsigned mismatch warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 28 03:26:33 PDT 2024


Author: Simon Pilgrim
Date: 2024-09-28T11:26:15+01:00
New Revision: 44478ba5f64b917657d8b8fd85f610eb9d043dce

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

LOG: Fix MSVC signed/unsigned mismatch warning. NFC.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
index f0295d289ed86a..529944044f02d2 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
@@ -779,7 +779,7 @@ MachineInstr *RISCVInstrInfo::foldMemoryOperandImpl(
     if (RISCV::getRVVMCOpcode(MI.getOpcode()) == RISCV::VMV_X_S) {
       unsigned Log2SEW =
           MI.getOperand(RISCVII::getSEWOpNum(MI.getDesc())).getImm();
-      if (STI.getXLen() < (1 << Log2SEW))
+      if (STI.getXLen() < (1U << Log2SEW))
         return nullptr;
       switch (Log2SEW) {
       case 3:


        


More information about the llvm-commits mailing list