[llvm] Fix build break when building RISCVInstrInfo.cpp with MSVC (PR #110342)
Daniel Paoliello via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 27 16:51:41 PDT 2024
https://github.com/dpaoliello created https://github.com/llvm/llvm-project/pull/110342
After #109774 MSVC is failing to build LLVM with the error:
```
llvm\lib\Target\RISCV\RISCVInstrInfo.cpp(782): warning C4018: '<': signed/unsigned mismatch
```
Fix is ensure that the RHS is an unsigned integer.
>From dc7e0a6dae2510cad4a3fef56559aba02a3008a4 Mon Sep 17 00:00:00 2001
From: Daniel Paoliello <danpao at microsoft.com>
Date: Fri, 27 Sep 2024 16:49:24 -0700
Subject: [PATCH] Fix build break when building RISCVInstrInfo.cpp with MSVC
---
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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