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:
[email protected]