From 4abe87588a9e9339c0ec6e4511c1d11207a35285 Mon Sep 17 00:00:00 2001 From: Yuanming Hu Date: Sun, 30 Aug 2020 16:23:08 -0400 Subject: [PATCH] clean up simplify --- taichi/transforms/simplify.cpp | 48 ---------------------------------- 1 file changed, 48 deletions(-) diff --git a/taichi/transforms/simplify.cpp b/taichi/transforms/simplify.cpp index 3e949752f1005..525306a544487 100644 --- a/taichi/transforms/simplify.cpp +++ b/taichi/transforms/simplify.cpp @@ -71,57 +71,9 @@ class BasicBlockSimplify : public IRVisitor { } } - // weaken indexing - // TODO: StructForStmt::loop_vars is deprecated - /*if (current_struct_for && stmt->width() == 1) { - auto &loop_vars = current_struct_for->loop_vars; - for (int k = 0; k < (int)loop_vars.size(); k++) { - auto diff = irpass::analysis::value_diff( - stmt->elements[0].stmt, stmt->elements[0].index, - current_struct_for->loop_vars[k]); - if (diff.linear_related() && diff.certain()) { - auto load = stmt->insert_before_me( - Stmt::make(LocalAddress(loop_vars[k], 0))); - load->ret_type.data_type = DataType::i32; - auto constant = stmt->insert_before_me( - Stmt::make(TypedConstant(diff.low))); - constant->ret_type.data_type = DataType::i32; - auto add = stmt->insert_before_me( - Stmt::make(BinaryOpType::add, load, constant)); - add->ret_type.data_type = DataType::i32; - stmt->replace_with(add); - stmt->parent->erase(stmt); - throw IRModified(); - } - } - }*/ - set_done(stmt); } - // Local variable operation optimizations: - // 1. Store forwarding - // - - bool modifies_local(Stmt *stmt, std::vector vars) { - if (stmt->is()) { - auto st = stmt->as(); - for (auto var : vars) { - if (st->ptr == var) { - return true; - } - } - } else if (stmt->is()) { - auto st = stmt->as(); - for (auto var : vars) { - if (st->dest == var) { - return true; - } - } - } - return false; - } - void visit(GlobalLoadStmt *stmt) override { if (is_done(stmt)) return;