TVM failed to build prefetch statement

Hi all, recently I’m still trying to be familiar with the TIR level of TVM, and I found an interesting problem. Based on the test case test_flatten_prefetch in tests/python/unittest/test_tir_transform_storage_flatten.py, I write a new example:

import tvm
from tvm import te

A = te.placeholder((25, 100, 4), name="A")
_A = tvm.tir.decl_buffer(A.shape, A.dtype, name="A")
i = te.size_var("i")
j = te.size_var("j")
region = [tvm.ir.Range.from_min_extent(i[0], i[1]) for i in [(i, 2), (j, 8), (0, 4)]]
stmt = tvm.tir.Prefetch(_A, region)
func = tvm.tir.PrimFunc([_A.data, i, j], stmt, buffer_map={_A.data: _A})
tvm.build(func)

I supposed the module would be built successfully, however, after I called tvm.build(func), the program crashed. I’m curious about the reason why this statement will make the program crash, and I’d appreciate any help :laughing: