tqchen commented on a change in pull request #9727:
URL: https://github.com/apache/tvm/pull/9727#discussion_r818686777
##########
File path: src/tir/ir/expr.cc
##########
@@ -1056,12 +1058,28 @@ TVM_STATIC_IR_FUNCTOR(ReprPrinter, vtable)
.set_dispatch<AnyNode>([](const ObjectRef& node, ReprPrinter* p) {
p->stream << "?"; });
// BufferLoad
+void BufferLoadNode::LegalizeDtype() {
+ int index_lanes = 1;
Review comment:
It is over generalization to allow vector indices in all dimensions.
Consider restricting the vector indices to only in the last dimension for now
`indices[-1]`.
##########
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:
DType(to be consistent with other places, as DType is short for
DataType). please add comment that this is only intended to be called from ctor
and after COW. Consider add an underscore after function to indicate the
intended rare behavior. Even better, we might want to only make it private and
expose to limited locations via friend, but this can be left as a TODO
##########
File path: src/tir/transforms/storage_rewrite.cc
##########
@@ -1118,6 +1204,11 @@ class VectorTypeAccessChecker : public StmtExprVisitor {
var_info.element_dtype = value_dtype.element_of();
}
+ int index_lanes = 1;
Review comment:
restrict vector index to the last dimension
--
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]