tqchen commented on a change in pull request #7216:
URL: https://github.com/apache/tvm/pull/7216#discussion_r552838662
##########
File path: python/tvm/tir/buffer.py
##########
@@ -247,7 +247,9 @@ def decl_buffer(
shape_dtype = shape[0].dtype if hasattr(shape[0], "dtype") else "int32"
elem_offset = Var("%s_elem_offset" % name, shape_dtype)
if data is None:
- data = Var(name, PointerType(PrimType(dtype)), span)
+ # store bool as i8
+ storage_dtype = "int8" if dtype == "bool" else dtype
Review comment:
This would complicates the logic of the PrimType. Constructors are
expected to be simple and "no surprise". Notably we still want to be able to
represent `i1` types in the type system. It is just in common platforms i8* is
used to store values of i1.
Considering the above reasons I don't think it is a good idea to have
PrimType constructor to do the conversation.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]