From d2ba0968d391a37b9d9ef9fe604d302b29561176 Mon Sep 17 00:00:00 2001 From: 7FM <41307817+7FM@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:35:13 +0200 Subject: [PATCH] [Scheduling] computeStartTimesInCycle: clear before recomputation (#6951) This PR adds a `clearStartTimesInCycle()` method to the ChainingProblem to simplify the reuse of one problem instance for multiple solving attempts. --- include/circt/Scheduling/Problems.h | 1 + lib/Scheduling/ChainingSupport.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/circt/Scheduling/Problems.h b/include/circt/Scheduling/Problems.h index 1b3da1c23d2d..59793dec16cf 100644 --- a/include/circt/Scheduling/Problems.h +++ b/include/circt/Scheduling/Problems.h @@ -373,6 +373,7 @@ class ChainingProblem : public virtual Problem { void setStartTimeInCycle(Operation *op, float time) { startTimeInCycle[op] = time; } + void clearStartTimeInCycle() { startTimeInCycle.clear(); } virtual PropertyStringVector getProperties(Operation *op) override; virtual PropertyStringVector getProperties(OperatorType opr) override; diff --git a/lib/Scheduling/ChainingSupport.cpp b/lib/Scheduling/ChainingSupport.cpp index 2b76e2dda8b4..531f0e15f475 100644 --- a/lib/Scheduling/ChainingSupport.cpp +++ b/lib/Scheduling/ChainingSupport.cpp @@ -91,6 +91,7 @@ LogicalResult scheduling::computeChainBreakingDependences( } LogicalResult scheduling::computeStartTimesInCycle(ChainingProblem &prob) { + prob.clearStartTimeInCycle(); return handleOperationsInTopologicalOrder(prob, [&](Operation *op) { // `op` will start within its abstract time step as soon as all operand // values have reached it.