Commit 386a497
committed
[RISCV] Use Zilsd Pseudos in ISel
This is proposed as an alternative to #169529. The idea here is during
selection, to choose between directly generating `LD`/`SD` or generating
`PseudoLD_RV32_OPT`/`PseudoSD_RV32_OPT` based on the volatility of the
access.
Volatile operations will always become `LD`/`SD`, but non-volatile
operations have a chance of becoming a pair of `LW`/`SW` depending on
the register allocation, which might save some `MV` instructions.
The advantage of this approach is that we don't need to go searching for
instructions to pair (including comparing their memory operands) in the
pre-ra pass, we already know these are paired, but they don't constrain
the register allocator, unlike `LD`/`SD`.
This PR is maybe not enough - we probably have to check the passes
between ISel and the Pre-RA Load/Store Pairing pass cope with this
correctly.
This also fixes a verifier error with the kill flags.1 parent 5f777b2 commit 386a497
File tree
3 files changed
+73
-51
lines changed- llvm
- lib/Target/RISCV
- test/CodeGen/RISCV
3 files changed
+73
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1817 | 1817 | | |
1818 | 1818 | | |
1819 | 1819 | | |
| 1820 | + | |
| 1821 | + | |
1820 | 1822 | | |
1821 | | - | |
1822 | | - | |
| 1823 | + | |
| 1824 | + | |
1823 | 1825 | | |
1824 | 1826 | | |
1825 | 1827 | | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
1833 | 1848 | | |
1834 | 1849 | | |
1835 | | - | |
| 1850 | + | |
1836 | 1851 | | |
1837 | 1852 | | |
1838 | 1853 | | |
1839 | 1854 | | |
| 1855 | + | |
| 1856 | + | |
1840 | 1857 | | |
1841 | | - | |
1842 | | - | |
| 1858 | + | |
| 1859 | + | |
1843 | 1860 | | |
1844 | 1861 | | |
1845 | 1862 | | |
1846 | 1863 | | |
1847 | 1864 | | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
1857 | 1881 | | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
1861 | 1887 | | |
1862 | 1888 | | |
1863 | | - | |
1864 | | - | |
1865 | | - | |
| 1889 | + | |
| 1890 | + | |
1866 | 1891 | | |
1867 | 1892 | | |
1868 | 1893 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
| 512 | + | |
| 513 | + | |
513 | 514 | | |
514 | 515 | | |
515 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 48 | + | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 66 | + | |
| 67 | + | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 72 | + | |
| 73 | + | |
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
| |||
158 | 155 | | |
159 | 156 | | |
160 | 157 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 158 | + | |
| 159 | + | |
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
| |||
200 | 196 | | |
201 | 197 | | |
202 | 198 | | |
203 | | - | |
204 | | - | |
| 199 | + | |
205 | 200 | | |
206 | 201 | | |
207 | 202 | | |
| |||
213 | 208 | | |
214 | 209 | | |
215 | 210 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
221 | 217 | | |
222 | 218 | | |
223 | 219 | | |
| |||
0 commit comments