Commit c170843
[TIR] HoistExpression, generalization of HoistIfThenElse (apache#11592)
* [TIR][Arith] Use non-inlined bindings when proving conditional
* [TIR][Arith] Recognize Var when used as a literal constraint
* [TIR][Arith] Added simplification of constrained if_then_else op
This feels like it should definitely be part of RewriteSimplify, but
that will require making CanInlineLet be a virtual function.
* [TIR] Implemented HoistExpression transformation
This is a generalized form of HoistIfThenElse, which can also hoist
Let bindings, or portions of conditional expressions. This will be
used in upcoming changes to separate compute loops into a slow loop
that handles edge cases and a fast branchless loop.
* [TIR] Expressed HoistIfThenElse as special case of HoistExpression
* Lint fixes
* Fixed breakage in tvmc unit test that relied on pass type
* More accurate handling of kUsingBlockVar
Didn't correctly reproduce previous behavior. In addition to
preventing hoisting of expressions that use a block
variable (e.g. threadIdx.x), should also prevent hoisting of
expressions across a "thread_extent" AttrStmt.
* Updated comment for HoistExpression pass
* Fix linting error1 parent 453689d commit c170843
File tree
10 files changed
+1335
-463
lines changed- include/tvm/tir
- python/tvm/tir/transform
- src
- arith
- tir/transforms
- tests/python
- driver/tvmc
- unittest
10 files changed
+1335
-463
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
367 | 380 | | |
368 | 381 | | |
369 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
593 | 596 | | |
594 | 597 | | |
595 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
596 | 667 | | |
597 | 668 | | |
598 | 669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
1673 | 1673 | | |
1674 | 1674 | | |
1675 | 1675 | | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
1676 | 1682 | | |
1677 | 1683 | | |
1678 | 1684 | | |
| |||
0 commit comments