Skip to content

Commit d222fa4

Browse files
authored
TargetInstrInfo: squelch a signedness warning on MSVC (#74078)
Follow up on 9468de4 (TargetInstrInfo: make getOperandLatency return optional (NFC)) to squelch a signedness warning on MSVC, reported by Simon Pilgrim.
1 parent 14e9917 commit d222fa4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/MC/MCInstrItineraries.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class InstrItineraryData {
220220
return std::nullopt;
221221

222222
UseCycle = *DefCycle - *UseCycle + 1;
223-
if (UseCycle > 0 &&
223+
if (UseCycle > 0u &&
224224
hasPipelineForwarding(DefClass, DefIdx, UseClass, UseIdx))
225225
// FIXME: This assumes one cycle benefit for every pipeline forwarding.
226226
UseCycle = *UseCycle - 1;

llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4110,7 +4110,7 @@ std::optional<unsigned> ARMBaseInstrInfo::getOperandLatency(
41104110
return std::nullopt;
41114111

41124112
UseCycle = *DefCycle - *UseCycle + 1;
4113-
if (UseCycle > 0) {
4113+
if (UseCycle > 0u) {
41144114
if (LdmBypass) {
41154115
// It's a variable_ops instruction so we can't use DefIdx here. Just use
41164116
// first def operand.

0 commit comments

Comments
 (0)