[llvm] MTM: improve operand latency when missing sched info (PR #101389)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 06:06:34 PDT 2024
================
@@ -761,6 +762,60 @@ static void updatePhysDepsDownwards(const MachineInstr *UseMI,
}
}
+/// Estimates the number of cycles elapsed between DefMI and UseMI, DefMI
+/// inclusive and UseMI exclusive, if they're non-null and in the same
+/// BasicBlock. Returns std::nullopt when UseMI is in a different MBB than
+/// DefMI.
+static std::optional<unsigned>
+estimateDefUseCycles(const TargetSchedModel &Sched, const MachineInstr *DefMI,
+ const MachineInstr *UseMI) {
+ if (!DefMI || !UseMI || DefMI == UseMI)
+ return 0;
----------------
arsenm wrote:
Why would any of these cases happen? Particularly the DefMI == UseMI case
https://github.com/llvm/llvm-project/pull/101389
More information about the llvm-commits
mailing list