Commit 4669fe9
RISC-V: Fix vsetvli local eliminate [PR114747]
vsetvli local eliminate is only consider the current demand instead of
full demand, and it will use that incomplete info to remove vsetvli.
Give following example from PR114747:
vsetvli a5,a1,e8,m4,ta,mu # 57, ratio=2, sew=8, lmul=4
vsetvli zero,a5,e16,m8,ta,ma # 58, ratio=2, sew=16, lmul=8
vle8.v v8,0(a0) # 13, demand ratio=2
vzext.vf2 v24,v8 # 14, demand sew=16 and lmul=8
Insn gcc-mirror#58 will removed because gcc-mirror#57 has satisfied demand of gcc-mirror#13, but it's
not consider gcc-mirror#14.
It should doing more demand analyze, but this bug only present in GCC 13
branch, and we should not change too much on this release branch, so the best
way is make the check more conservative - remove only if the target
vsetvl_discard_result having same SEW and LMUL as the source vsetvli.
gcc/ChangeLog:
PR target/114747
* config/riscv/riscv-vsetvl.cc (local_eliminate_vsetvl_insn):
Check target vsetvl_discard_result and source vsetvli has same
SEW and LMUL.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/vsetvl/pr114747.c: New.1 parent 25c8c28 commit 4669fe9
File tree
2 files changed
+28
-0
lines changed- gcc
- config/riscv
- testsuite/gcc.target/riscv/rvv/vsetvl
2 files changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1109 | 1119 | | |
1110 | 1120 | | |
1111 | 1121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments