Commit c9568d6
[RISCV] Fix coalesced vsetvli's AVL LiveInterval not always being shrunk (llvm#98286)
Most of the time when we coalesce and delete a vsetvli, we shrink the
LiveInterval of its AVL register now that there is one less use. However
there's one edge case we were missing where if we have two vsetvlis with
no users of vl or vtype in between, we coalesced a vsetvli without
shrinking it's AVL.
This fixes it by shrinking the LiveInterval whenever we delete a
vsetvli, and also makes the LiveIntervals consistent in-situ by not
removing the use before shrinking.
This fixes a -verify-machineinstrs assertion in an MIR test case I found
while investigating
llvm#97264 (comment).
I couldn't recreate this at the LLVM IR level, seemingly because
RISCVInsertVSETVLI will just avoid inserting extra vsetvlis that don't
need coalesced.1 parent 4deb31f commit c9568d6
File tree
2 files changed
+32
-5
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV/rvv
2 files changed
+32
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1686 | 1686 | | |
1687 | 1687 | | |
1688 | 1688 | | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
1693 | 1689 | | |
1694 | | - | |
| 1690 | + | |
1695 | 1691 | | |
1696 | 1692 | | |
1697 | 1693 | | |
| |||
1720 | 1716 | | |
1721 | 1717 | | |
1722 | 1718 | | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
1723 | 1722 | | |
| 1723 | + | |
| 1724 | + | |
1724 | 1725 | | |
1725 | 1726 | | |
1726 | 1727 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
576 | 580 | | |
577 | 581 | | |
578 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
0 commit comments