From 4994e0124d16a9140a1e47aeef6cdd41508abeb8 Mon Sep 17 00:00:00 2001 From: Yu Fang Date: Mon, 16 Aug 2021 11:14:49 +0800 Subject: [PATCH] clean up multiple ConstStmt replacement --- taichi/transforms/offload.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/taichi/transforms/offload.cpp b/taichi/transforms/offload.cpp index 8535034c85a90..d841b9387e12b 100644 --- a/taichi/transforms/offload.cpp +++ b/taichi/transforms/offload.cpp @@ -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()) { - auto copy = op->as()->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()) { auto copy = op->clone(); copy->as()->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()) {