Skip to content

Commit

Permalink
Re-reverting 8274
Browse files Browse the repository at this point in the history
tir.allocate should be lowered to tvm built-in
in order for them to lowered TVMBackendAllocWorkspace
calls and not forced onto the stack.

Change-Id: I393b3c4580540d699e8ec3e4d62bb5f8c479553e
  • Loading branch information
manupak committed Sep 14, 2021
1 parent f6b00a9 commit 0523597
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/tir/transforms/lower_tvm_builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,6 @@ class BuiltinLower : public StmtExprMutator {
op = stmt.as<AllocateNode>();
// Get constant allocation bound.
int64_t nbytes = GetVectorBytes(op->dtype);
if (device_type_.defined()) {
if (const auto* dev_type = device_type_.as<IntImmNode>()) {
if (dev_type->value == kDLCPU) {
int32_t constant_size = op->constant_allocation_size();
if (constant_size > 0 && constant_size * nbytes < runtime::kMaxStackAlloca) {
return stmt;
}
}
}
}
PrimExpr total_bytes = make_const(op->extents[0].dtype(), nbytes);
for (size_t i = 0; i < op->extents.size(); ++i) {
total_bytes = total_bytes * op->extents[i];
Expand Down

0 comments on commit 0523597

Please sign in to comment.