[llvm] TargetInstrInfo: make getOperandLatency return optional (NFC) (PR #73769)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 00:31:27 PST 2023


================
@@ -4032,7 +4026,7 @@ ARMBaseInstrInfo::getOperandLatency(const InstrItineraryData *ItinData,
   // This may be a def / use of a variable_ops instruction, the operand
   // latency might be determinable dynamically. Let the target try to
   // figure it out.
-  int DefCycle = -1;
+  std::optional<unsigned> DefCycle = std::nullopt;
----------------
fpetrogalli wrote:

Can't this just be 
```suggestion
  std::optional<unsigned> DefCycle;
```

https://github.com/llvm/llvm-project/pull/73769


More information about the llvm-commits mailing list