Lunderberg commented on code in PR #14488:
URL: https://github.com/apache/tvm/pull/14488#discussion_r1159942478


##########
include/tvm/script/ir_builder/tir/ir.h:
##########
@@ -428,16 +428,26 @@ void Evaluate(PrimExpr value);
 
 /*!
  * \brief Create a TIR var that represents a pointer
+ *
  * \param dtype The data type of the pointer.
+ *
  * \param storage_scope The storage scope of the pointer.
+ *
  * \param is_size_var Whether the pointer is a size var.
+ *
+ * \param is_unknown_type Used to distinguish between
+ * `PrimType(DataType::Handle())` and
+ * `PointerType(PrimType(DataType::Void()))`.  If true, resolve dtype
+ * of `Void()` as `PrimType`, and if false resolve dtype of `Void()`

Review Comment:
   I believe so, because the `dtype` is providing the type of the pointed-to 
object, not the type of the pointer itself.  While we could special-case 
passing of a `DataType(kHandle, 0, 0)` to produce 
`PrimType(DataType::Handle())`, that would give unexpected results if somebody 
tries to write a pointer-to-pointer as `T.handle("handle")` and accidentally 
hits the special-case.



-- 
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]

Reply via email to