tqchen commented on code in PR #15517:
URL: https://github.com/apache/tvm/pull/15517#discussion_r1290456536
##########
src/tir/transforms/storage_rewrite.cc:
##########
@@ -1083,17 +1084,14 @@ struct BufferVarInfo {
DataType preferred_base_type = *base_access_dtype.begin();
- // If there is only one vectorizable size used to access the
- // buffer, and if that access size is compatible with the array
- // size, then the buffer is vectorizable. In the future, this
- // could be improved to allow vectorized buffer access of size
- // GCD(*lanes_used), if necessary.
int preferred_lanes = element_dtype.lanes();
- if ((element_dtype.lanes() == 1) && (access_dtype.size() == 1)) {
+ if (element_dtype.lanes() == 1) {
+ int lanes = access_dtype.begin()->lanes();
+ for (auto dtype : access_dtype) {
+ lanes = std::gcd(lanes, dtype.lanes());
Review Comment:
use https://github.com/apache/tvm/blob/main/src/arith/int_operator.h#L171
--
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]