Lunderberg commented on a change in pull request #9727:
URL: https://github.com/apache/tvm/pull/9727#discussion_r770049796



##########
File path: include/tvm/tir/expr.h
##########
@@ -610,6 +610,14 @@ class BufferLoadNode : public PrimExprNode {
   /*! \brief The indices location to be loaded. */
   Array<PrimExpr> indices;
 
+  /*! \brief Set the dtype based on the buffer/indices
+   *
+   * Usually, this will be the same dtype as the buffer.  This may
+   * have a different number of lanes than the buffer's dtype if index
+   * values have more than 1 lane.
+   */
+  void LegalizeDtype();

Review comment:
       This is primarily to allow for shared implementations between the 
`BufferStore` and `BufferLoad` visitors, without needing a dedicated node to 
represent the buffer access.  See [this 
comment](https://github.com/apache/tvm-rfcs/pull/42#issuecomment-963314748) for 
the discussion and an example.
   
   In this case, the `LegalizeDtype` function is called from the constructor, 
but is also callable after `CopyOnWrite`+mutation.  (e.g. 
[link](https://github.com/Lunderberg/tvm/blob/1dd14389a/src/tir/transforms/storage_rewrite.cc#L1391))




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