From bd73a57da15fb8b355d09c04478ba376cae6083f Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Thu, 27 Jul 2023 17:37:51 +0800 Subject: [PATCH] [Polish Codes] Delete dead codes of general_fusion_merge_pass (#55608) --- .../hlir/pass/general_fusion_merge_pass.cc | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/paddle/cinn/hlir/pass/general_fusion_merge_pass.cc b/paddle/cinn/hlir/pass/general_fusion_merge_pass.cc index a4b4a64cef1..4b4f7c17a4d 100644 --- a/paddle/cinn/hlir/pass/general_fusion_merge_pass.cc +++ b/paddle/cinn/hlir/pass/general_fusion_merge_pass.cc @@ -1933,68 +1933,6 @@ class GeneralFusionMergePassHelper : public FusionHelperBase { } } - bool IsDependency( - const GroupPtr& producer_g, - const GroupPtr& consumer, - const std::unordered_set& consumers) { - std::queue candidates; - candidates.push(consumer); - - std::unordered_set visited_set; - while (!candidates.empty()) { - auto& candidate = candidates.front(); - candidates.pop(); - for (const auto& producer_and_list : candidate->producer_groups()) { - if (producer_and_list.get() == producer_g.get()) { - continue; - } - const auto& producer = - std::dynamic_pointer_cast(producer_and_list); - if (consumers.count(producer)) { - return true; - } - if (!visited_set.count(producer)) { - visited_set.insert(producer); - candidates.push(producer); - } - } - } - return false; - } - - bool IsDependencySimplify( - const GroupPtr& producer_g, - const GroupPtr& consumer, - const std::unordered_set& consumers) { - std::queue candidates; - candidates.push(consumer); - // check upper. - int check_upper_depth = producer_g.get() ? producer_g->max_depth : INT_MAX; - std::unordered_set visited_set; - while (!candidates.empty()) { - auto& candidate = candidates.front(); - candidates.pop(); - for (auto& producer_and_list : candidate->producer_groups()) { - if (producer_and_list.get() == producer_g.get()) { - continue; - } - const auto& producer = - std::dynamic_pointer_cast(producer_and_list); - if (producer->min_depth > check_upper_depth) { - continue; - } - if (consumers.count(producer)) { - return true; - } - if (!visited_set.count(producer)) { - visited_set.insert(producer); - candidates.push(producer); - } - } - } - return false; - } - bool GeneralInputFuse() { VLOG(3) << "GeneralInputFuse...!"; auto updated = false; -- GitLab