You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/24 23:06:20 UTC

[GitHub] [incubator-tvm] kparzysz-quic commented on pull request #6066: [TIR][Transform] HoistIfThenElse added

kparzysz-quic commented on pull request #6066:
URL: https://github.com/apache/incubator-tvm/pull/6066#issuecomment-663767437


   This is a limited case of "loop unswitching".  Please consider a more general solution, where
   ```
   for (i = 0..N) {
     // statement A
     if (invariant-condition) {
       // statement B
     } else {
       // statement C
     }
     // statement D
   }
   ```
   is transformed into
   ```
   if (invariant-condition) {
     for (i = 0..N) {
       // statement A
       // statement B
       // statement D
     }
   } else {
     for (i = 0..N) {
       // statement A
       // statement C
       // statement D
     }
   }
   ```
   
   Using the same logic you could unswitch attribute statements, if needed.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org