Skip to content

Commit

Permalink
clean up multiple ConstStmt replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
squarefk committed Aug 16, 2021
1 parent 87667a7 commit 4994e01
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions taichi/transforms/offload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,18 +520,13 @@ class FixCrossOffloadReferences : public BasicStmtVisitor {
return false;
if (stmt_to_offloaded[stmt] == stmt_to_offloaded[op]) // same OffloadedStmt
return false;
if (op->is<ConstStmt>()) {
auto copy = op->as<ConstStmt>()->copy();
stmt_to_offloaded[copy.get()] = stmt_to_offloaded[stmt];
stmt->set_operand(index, copy.get());
stmt->insert_before_me(std::move(copy));
}
if (op->is<GlobalPtrStmt>()) {
auto copy = op->clone();
copy->as<GlobalPtrStmt>()->activate = false;
stmt_to_offloaded[copy.get()] = stmt_to_offloaded[stmt];
stmt->set_operand(index, copy.get());
stmt->insert_before_me(std::move(copy));
return true;
}

if (local_to_global_offset.find(op) == local_to_global_offset.end()) {
Expand Down

0 comments on commit 4994e01

Please sign in to comment.