Commit 11a7e77
committed
[RISCV] Canonicalize AVL=setvli to AVL=Imm or AVL=VLMAX
This patch adds a transform to the local prepass in InsertVSETVLI which canonicalizes an AVL of a register from another vsetvli into immediate or VLMAX when VTYPE is the same. In this patch, I chose to be conservative and avoid arbitrary vreg forwarding due to profitability concerns about possibility overlapping live ranges.
This has the effect of eliminating vsetvli instructions in loops which are walking either VLMAX or a constant number of lanes per iteration.
Differential Revision: https://reviews.llvm.org/D1258121 parent ff6fe39 commit 11a7e77
File tree
2 files changed
+29
-8
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
2 files changed
+29
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1242 | 1242 | | |
1243 | 1243 | | |
1244 | 1244 | | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1245 | 1268 | | |
1246 | 1269 | | |
1247 | 1270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
| 594 | + | |
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
599 | | - | |
600 | | - | |
| 598 | + | |
| 599 | + | |
601 | 600 | | |
602 | 601 | | |
603 | 602 | | |
604 | 603 | | |
605 | 604 | | |
606 | | - | |
| 605 | + | |
607 | 606 | | |
608 | | - | |
| 607 | + | |
609 | 608 | | |
610 | 609 | | |
611 | 610 | | |
| |||
645 | 644 | | |
646 | 645 | | |
647 | 646 | | |
648 | | - | |
649 | 647 | | |
650 | 648 | | |
651 | 649 | | |
| |||
719 | 717 | | |
720 | 718 | | |
721 | 719 | | |
722 | | - | |
| 720 | + | |
723 | 721 | | |
724 | 722 | | |
725 | 723 | | |
| |||
0 commit comments