From ee896b9eee1af0770ca85aecd2c7232151373015 Mon Sep 17 00:00:00 2001 From: AdvaySingh1 Date: Wed, 18 Feb 2026 09:08:25 -0800 Subject: [PATCH] Removed sorting of similar candidate_gates for unnessessary optimization --- passes/silimate/infer_ce.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/passes/silimate/infer_ce.cc b/passes/silimate/infer_ce.cc index 72b4eddc9..a411b49dd 100644 --- a/passes/silimate/infer_ce.cc +++ b/passes/silimate/infer_ce.cc @@ -450,17 +450,12 @@ struct InferCeWorker for (auto idx : net_to_accepted[bit]) candidate_gates.insert(idx); - // HEURISTIC: Only check top 3 gates (by size) for reuse - const int MAX_REUSE_CHECKS = 3; - - std::vector sorted_candidates(candidate_gates.begin(), candidate_gates.end()); - std::sort(sorted_candidates.begin(), sorted_candidates.end(), [&](size_t a, size_t b) { - return accepted_gates[a].regs.size() > accepted_gates[b].regs.size(); - }); + // HEURISTIC: Only check limited gates for reuse + const int MAX_REUSE_CHECKS = 20; bool found_match = false; int checked = 0; - for (auto idx : sorted_candidates) { + for (auto idx : candidate_gates) { if (checked >= MAX_REUSE_CHECKS) break;