diff --git a/taichi/transforms/cache_loop_invariant_global_vars.cpp b/taichi/transforms/cache_loop_invariant_global_vars.cpp index 808d8f3a5cbe99..f9a7154d10a856 100644 --- a/taichi/transforms/cache_loop_invariant_global_vars.cpp +++ b/taichi/transforms/cache_loop_invariant_global_vars.cpp @@ -155,14 +155,14 @@ class CacheLoopInvariantGlobalVars : public LoopInvariantDetector { } void visit(GlobalLoadStmt *stmt) override { - if (is_offload_unique(stmt->src) && is_operand_loop_invariant_impl(stmt->src, stmt->parent)) { + if (is_offload_unique(stmt->src) && is_operand_loop_invariant(stmt->src, stmt->parent)) { cache_global_to_local(stmt, stmt->src, CacheStatus::Read); } } void visit(GlobalStoreStmt *stmt) override { - if (is_offload_unique(stmt->dest) && is_operand_loop_invariant_impl(stmt->dest, stmt->parent)) { + if (is_offload_unique(stmt->dest) && is_operand_loop_invariant(stmt->dest, stmt->parent)) { cache_global_to_local(stmt, stmt->dest, CacheStatus::Write); diff --git a/taichi/transforms/loop_invariant_code_motion.cpp b/taichi/transforms/loop_invariant_code_motion.cpp index dc1ad5c0c023cd..0f8ec5fa7b8ab4 100644 --- a/taichi/transforms/loop_invariant_code_motion.cpp +++ b/taichi/transforms/loop_invariant_code_motion.cpp @@ -42,16 +42,6 @@ class LoopInvariantCodeMotion : public LoopInvariantDetector { } } - void visit(GlobalTemporaryStmt *stmt) override { - if (is_loop_invariant(stmt, stmt->parent)) { - auto replacement = stmt->clone(); - stmt->replace_usages_with(replacement.get()); - - modifier.insert_before(current_loop_stmt(), std::move(replacement)); - modifier.erase(stmt); - } - } - void visit(ExternalPtrStmt *stmt) override { if (is_loop_invariant(stmt, stmt->parent)) { auto replacement = stmt->clone();