wrongtest commented on PR #11181:
URL: https://github.com/apache/tvm/pull/11181#issuecomment-1113995285

   > Because the value of `last_index_for_tbaa` is cached before this 
correction is applied, I think it would have incorrect alias information when 
this correction is applied
   
   Thanks for the notes! After a re look-through, IIUC, I think the "index" for 
alias info should keep the same element unit for all accesses, so we may not 
change it either the `last_index` is corrected or not. 
   
   However, before any changes, I find another concern on aliased buffers. 
since in the new convention, two buffer object (maybe of different datatype) 
with the same buffer var alias to each other, it may not be safe to use current 
buffer's dtype as index unit for alias info.
   
   eg1:
   ```python
   # A[16] and B[4] may inferred as NoAlias by tbaa
   A = T.allocate([64], "int8")
   B = T.buffer_decl([16], "int32", data=A.data)
   A[16] = 1   # tag: (A.data, idx=16)  
   B[4] = 1    # tag: (A.data, idx=4)      
   ```
   
   eg2:
   ```python
   # A and B inferred as NoAlias since they have different buffer var
   A = T.allocate([64], "int8")
   B_data = T.address_of(A[4])  # usmp style alias
   B = T.buffer_decl([64], "int8", data=B_data)
   A[7] = 1   # tag: (A.data, idx=7)
   B[3] = 2   # tag: (B.data, idx=3)
   ```


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