================
@@ -112,11 +168,58 @@ bool
RISCVPreRAMachineSchedStrategy::tryCandidate(SchedCandidate &Cand,
// Fall through to original instruction order.
if ((Zone->isTop() && TryCand.SU->NodeNum < Cand.SU->NodeNum) ||
- (!Zone->isTop() && TryCand.SU->NodeNum > Cand.SU->NodeNum)) {
+ (!Zone->isTop() && TryCand.SU->NodeNum > Cand.SU->NodeNum))
TryCand.Reason = NodeOrder;
- return true;
- }
}
- return false;
+ //-------------------------------------------------------------------------//
+ // Below is RISC-V specific scheduling heuristics.
+ //-------------------------------------------------------------------------//
+
+ // Add RISC-V specific heuristic only when TryCand isn't selected or
+ // selected as node order.
+ if (TryCand.Reason != NodeOrder && TryCand.Reason != NoCand)
+ return true;
+
+ // TODO: We should not use `CandReason::Cluster` here, but is there a
----------------
mshockwave wrote:
CandReason is only for diagnosing purposes, so this is probably fine. We can
also add a `CandReason::Other` or `CandReason::Custom` in the future.
https://github.com/llvm/llvm-project/pull/95924
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits