FranckQC edited a comment on pull request #9482:
URL: https://github.com/apache/tvm/pull/9482#issuecomment-972579646


   > 
   > 
   > Hi @FranckQC, I am also very interested in the CSE pass. In our 
circumstances we suffer from duplicate index computations produced by loop 
unroll, like
   > 
   > ```
   > A[i*256 + j*16 + 0] = B[i*256 + j*16 + 4096]
   > A[i*256 + j*16 + 1] = B[i*256 + j*16 + 4097]
   > ...
   > ```
   > 
   > We have to depend on target backend optimize abilities which may or maynot 
optimize them out. It would be great if CSE can handle part of these things in 
TIR level.
   
   Hi @wrongtest 
   Thank you, I'm very glad to know that the pass might be useful to you too!
   
   Yes, these kind of redundancies should definitely be commoned out by this 
new CSE pass.
   For the specific example that you have given, I expect the result to be 
something like :
   
   ```
   Let cse_var_1 = i*256 + j*16 in
       A[cse_var_1 + 0] = B[cse_var_1 + 4096];
       A[cse_var_1 + 1] = B[cse_var_1 + 4097];
   ```
       
   Do not hesitate to try the pass out, and to let me know if it does what we 
hope. I'd be happy to help of course if that's needed.
   
   Best regards.


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