Skip to content

Commit

Permalink
Revert #16236
Browse files Browse the repository at this point in the history
The buf reported in #16237 can be resolved by tracking variable usage
in a thread extent.
  • Loading branch information
Lunderberg committed Dec 18, 2023
1 parent ae95d14 commit 0ef00cb
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/tir/transforms/ir_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,8 @@ Pass ConvertSSA() {
tir::IRConvertSSA converter;
Map<GlobalVar, BaseFunc> functions;
bool made_change = false;
// FIXME: This is just a temporal workaround to ensure free vars
// in device function have the same pointer as the host function
for (auto [gvar, base_func] : mod->functions) {
if (auto* ptr = base_func.as<tir::PrimFuncNode>()) {
if (!ptr->HasNonzeroAttr(tir::attr::kIsEntryFunc)) {
continue;
}
auto updated = converter.VisitPrimFunc(GetRef<tir::PrimFunc>(ptr));
if (!updated.same_as(base_func)) {
made_change = true;
Expand All @@ -765,19 +760,6 @@ Pass ConvertSSA() {
}
functions.Set(gvar, base_func);
}
for (auto [gvar, base_func] : mod->functions) {
if (auto* ptr = base_func.as<tir::PrimFuncNode>()) {
if (ptr->HasNonzeroAttr(tir::attr::kIsEntryFunc)) {
continue;
}
auto updated = converter.VisitPrimFunc(GetRef<tir::PrimFunc>(ptr));
if (!updated.same_as(base_func)) {
made_change = true;
base_func = updated;
}
functions.Set(gvar, base_func);
}
}
if (made_change) {
mod.CopyOnWrite()->functions = std::move(functions);
}
Expand Down

0 comments on commit 0ef00cb

Please sign in to comment.