diff --git a/llvm/include/llvm/MC/MCInstrItineraries.h b/llvm/include/llvm/MC/MCInstrItineraries.h index b17c41ce3aa4a..d1c2e788ee810 100644 --- a/llvm/include/llvm/MC/MCInstrItineraries.h +++ b/llvm/include/llvm/MC/MCInstrItineraries.h @@ -220,7 +220,7 @@ class InstrItineraryData { return std::nullopt; UseCycle = *DefCycle - *UseCycle + 1; - if (UseCycle > 0 && + if (UseCycle > 0u && hasPipelineForwarding(DefClass, DefIdx, UseClass, UseIdx)) // FIXME: This assumes one cycle benefit for every pipeline forwarding. UseCycle = *UseCycle - 1; diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index 94f34b1276966..ce65c8e5245b1 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -4110,7 +4110,7 @@ std::optional ARMBaseInstrInfo::getOperandLatency( return std::nullopt; UseCycle = *DefCycle - *UseCycle + 1; - if (UseCycle > 0) { + if (UseCycle > 0u) { if (LdmBypass) { // It's a variable_ops instruction so we can't use DefIdx here. Just use // first def operand.