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

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 07:50:48 PST 2023


================
@@ -1452,8 +1452,9 @@ bool TargetInstrInfo::hasLowDefLatency(const TargetSchedModel &SchedModel,
     return false;
 
   unsigned DefClass = DefMI.getDesc().getSchedClass();
-  int DefCycle = ItinData->getOperandCycle(DefClass, DefIdx);
-  return (DefCycle != -1 && DefCycle <= 1);
+  std::optional<unsigned> DefCycle =
+      ItinData->getOperandCycle(DefClass, DefIdx);
+  return DefCycle <= 1;
----------------
bjope wrote:

Well, we got pretty large benchmarks regressions that bisected to your NFC patch. That is why I've been doing detailed code review about everything that I've noticed that actually might impact codegen.

Looks like this one was the main problem for our regressions. The thing with bundles mentioned here, https://github.com/llvm/llvm-project/pull/73769#discussion_r1413801271 , could be an issue as well. But I haven't seen any impact related to that one yet.

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


More information about the llvm-commits mailing list