Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions csrc/device_lower/pass/alias_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,15 +769,23 @@ class AllocationInfoMap : private kir::IrVisitor {

void handle(kir::ForLoop* for_loop) final {
auto loop_info = scope_map_.getLoopScopeInfo(for_loop);
current_stack_.push_back(loop_info);
if (!for_loop->isTrivial()) {
// Parallelized loops do not result in for loops in the CUDA kernel, so
// they should not affect liveness analysis. This means that
// current_stack_ will differ from kir::IrVisitor::for_loops_, which will
// actually hold all ForLoops regardless of parallelization.
current_stack_.push_back(loop_info);
}
if (debug_printer_) {
debug_printer_->pushScope();
}
kir::IrVisitor::handle(for_loop);
if (debug_printer_) {
debug_printer_->popScope();
}
current_stack_.pop_back();
if (!for_loop->isTrivial()) {
current_stack_.pop_back();
}
}

void handle(kir::IfThenElse* ite) final {
Expand Down