[llvm] TargetInstrInfo: make getOperandLatency return optional (NFC) (PR #73769)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 1 01:16:01 PST 2023
================
@@ -155,22 +155,21 @@ unsigned PPCInstrInfo::getInstrLatency(const InstrItineraryData *ItinData,
if (!MO.isReg() || !MO.isDef() || MO.isImplicit())
continue;
- int Cycle = ItinData->getOperandCycle(DefClass, i);
- if (Cycle < 0)
+ std::optional<unsigned> Cycle = ItinData->getOperandCycle(DefClass, i);
+ if (!Cycle)
----------------
artagnon wrote:
I personally don't like `.has_value()`.
https://github.com/llvm/llvm-project/pull/73769
More information about the llvm-commits
mailing list