From ed9626f3368116095688ed79561fc794943dc6ce Mon Sep 17 00:00:00 2001 From: zyfncg Date: Tue, 29 Oct 2024 06:45:28 +0000 Subject: [PATCH 1/2] delele some redundant code --- paddle/cinn/ir/module.cc | 4 ---- paddle/cinn/optim/optimize.cc | 8 -------- 2 files changed, 12 deletions(-) diff --git a/paddle/cinn/ir/module.cc b/paddle/cinn/ir/module.cc index 7853c734a0b4b5..0850590a9fb223 100644 --- a/paddle/cinn/ir/module.cc +++ b/paddle/cinn/ir/module.cc @@ -25,10 +25,6 @@ namespace cinn { namespace ir { void Module::Builder::AddFunction(ir::LoweredFunc func) { - optim::Simplify(&(func->body)); - optim::SimplifyForLoops(&(func->body)); - optim::SimplifyBlocks(&(func->body)); - func->body = optim::Optimize(func->body, module_->target); module_->functions.push_back(func); } diff --git a/paddle/cinn/optim/optimize.cc b/paddle/cinn/optim/optimize.cc index d757cd9d9114b1..33ea66aff49691 100644 --- a/paddle/cinn/optim/optimize.cc +++ b/paddle/cinn/optim/optimize.cc @@ -63,11 +63,7 @@ Expr Optimize(Expr e, VLOG(4) << "After Optimize ReplaceCrossThreadReduction:" << copied; ReplaceCrossBlockReduction(&copied); VLOG(4) << "After Optimize ReplaceCrossBlockReduction:" << copied; - UnrollLoop(&copied); - VLOG(4) << "After Optimize UnrollLoop:" << copied; - VectorizeLoops(&copied, target); - VLOG(4) << "After Optimize VectorizeLoops:" << copied; cinn::common::DefaultDeviceTarget().arch.Match( [&](std::variant) { }, @@ -120,10 +116,6 @@ Expr Optimize(Expr e, ir::Module Optimize(const ir::Module& module, const Target& target) { auto copied = ir::ir_utils::IRCopy(Expr(module)); - ReplaceCrossThreadReduction(&copied); - UnrollLoop(&copied); - VectorizeLoops(&copied, Target()); - VLOG(10) << "After VectorizeLoops:" << copied.as_module_ref(); RemoveScheduleBlock(&copied); VLOG(10) << "After RemoveScheduleBlock:" << copied.as_module_ref(); LowerFunctionCallBindVars(&copied); From fd0e8e09454523fd2af03b912b81763fcd2d8287 Mon Sep 17 00:00:00 2001 From: zyfncg Date: Tue, 29 Oct 2024 07:34:08 +0000 Subject: [PATCH 2/2] remove fold_cinn_call --- paddle/cinn/optim/optimize.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/paddle/cinn/optim/optimize.cc b/paddle/cinn/optim/optimize.cc index 33ea66aff49691..1dadc2c26ecab0 100644 --- a/paddle/cinn/optim/optimize.cc +++ b/paddle/cinn/optim/optimize.cc @@ -54,8 +54,6 @@ Expr Optimize(Expr e, auto copied = ir::ir_utils::IRCopy(e); - FoldCINNCallArguments(&copied); - TransformPolyForToFor(&copied); ReplaceConstParamToInteger(&copied); // Simplify already contains CastSimplify Simplify(&copied);