There is a benefit of having the association between a Var
and the corresponding Buffer
throughout the optimizations, including codegen. Buffer
is not a PrimExpr
, so it cannot be passed around directly, but it contains a lot of useful information (such as shape etc.). If we had the buffer_var -> Buffer
mapping, we could rely on that to associate any Var
with its buffer (if there is any).
However, the buffer_map
is cleared in MakePackedAPI
, and the LLVM codegen expects it to be empty. What are the reasons for not having it? Can we keep it?