syang-ng opened a new issue #9401: URL: https://github.com/apache/tvm/issues/9401
It seems that the name of a buffer can be invalid after applying pass `PlanAndUpdateBufferAllocationLocation` and `CompactBufferAllocation`. ### Expected behavior The TVM can normally report the exception message. ### Actual behavior After applying pass `PlanAndUpdateBufferAllocationLocation` and `CompactBufferAllocation`, there will be a crash if we continue to use pass `LowerMatchBuffer`. I used gdb to trace this bug:  According to the source code, it seems that the name of the buffer will be invalid after applying these two passes for the module.  ### Environment Ubuntu18.04, cmake 3.18.2, llvm 12, tested on latest git 4087e72 ### Steps to reproduce Here is the script to reproduce the bug: ```python import tvm from tvm import tir var = tir.Var(name='v', dtype='int32') buf = tir.decl_buffer((1,), name='buf') zero = tir.const(0) buf_load = tir.expr.BufferLoad(buffer=buf, indices=[zero]) then_case = tir.Store(buffer_var=var,value=buf_load,index=zero) for_stmt = tir.For(loop_var=var, min_val=0, extent=0, kind=1,body=then_case) y = tir.IfThenElse(then_case=then_case,else_case=for_stmt,condition=tir.Cast('bool', zero)) f=tir.PrimFunc(body=y,params=[var]) mod = tvm.IRModule({'main':f}) mod = tir.transform.PlanAndUpdateBufferAllocationLocation()(mod) mod = tir.transform.CompactBufferAllocation()(mod) mod = tir.transform.LowerMatchBuffer()(mod) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
