Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hitonami committed Sep 19, 2022
1 parent 7773702 commit 22029e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
4 changes: 2 additions & 2 deletions taichi/transforms/cache_loop_invariant_global_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
10 changes: 0 additions & 10 deletions taichi/transforms/loop_invariant_code_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 22029e5

Please sign in to comment.