Commit a7476b4
committed
[RISCV] Reduce size of CSR lookup tables. NFC
Instead of storing 3 different names in each row of the table, use
a separate row for each name and use a flag to indicate what type
of name it is. The AltName and DeprecatedName aren't used often enough
to justify storing them as a possiblity for every register.
This reduces the .rodata says by 27k and reduces the number of
dynamic relocations since we now only need 1 lookup by name function.
The lookup by name function each contained a ~400 entry table of
const char* pointing to constant strings. Each of those requires a dynamic
relocation.1 parent d7acf03 commit a7476b4
File tree
4 files changed
+36
-36
lines changed- llvm/lib/Target/RISCV
- AsmParser
- MCTargetDesc
4 files changed
+36
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1915 | 1915 | | |
1916 | 1916 | | |
1917 | 1917 | | |
| 1918 | + | |
| 1919 | + | |
1918 | 1920 | | |
1919 | 1921 | | |
1920 | 1922 | | |
| |||
1952 | 1954 | | |
1953 | 1955 | | |
1954 | 1956 | | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
1959 | | - | |
1960 | | - | |
1961 | | - | |
1962 | | - | |
| 1957 | + | |
1963 | 1958 | | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
1964 | 1971 | | |
1965 | 1972 | | |
1966 | 1973 | | |
1967 | 1974 | | |
1968 | 1975 | | |
1969 | 1976 | | |
1970 | | - | |
| 1977 | + | |
1971 | 1978 | | |
1972 | 1979 | | |
1973 | 1980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | | - | |
459 | 457 | | |
460 | 458 | | |
461 | 459 | | |
| |||
467 | 465 | | |
468 | 466 | | |
469 | 467 | | |
470 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 22 | | |
29 | 23 | | |
30 | 24 | | |
| |||
37 | 31 | | |
38 | 32 | | |
39 | 33 | | |
| 34 | + | |
| 35 | + | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
46 | | - | |
47 | | - | |
| 42 | + | |
| 43 | + | |
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
| |||
57 | 53 | | |
58 | 54 | | |
59 | 55 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 56 | | |
71 | 57 | | |
72 | 58 | | |
| |||
123 | 109 | | |
124 | 110 | | |
125 | 111 | | |
126 | | - | |
127 | 112 | | |
| 113 | + | |
| 114 | + | |
128 | 115 | | |
129 | 116 | | |
130 | 117 | | |
131 | 118 | | |
132 | 119 | | |
133 | | - | |
134 | 120 | | |
| 121 | + | |
| 122 | + | |
135 | 123 | | |
136 | 124 | | |
137 | 125 | | |
| |||
245 | 233 | | |
246 | 234 | | |
247 | 235 | | |
248 | | - | |
249 | 236 | | |
| 237 | + | |
| 238 | + | |
250 | 239 | | |
251 | 240 | | |
252 | 241 | | |
| |||
298 | 287 | | |
299 | 288 | | |
300 | 289 | | |
301 | | - | |
302 | 290 | | |
| 291 | + | |
| 292 | + | |
303 | 293 | | |
304 | 294 | | |
305 | 295 | | |
| |||
336 | 326 | | |
337 | 327 | | |
338 | 328 | | |
339 | | - | |
340 | 329 | | |
| 330 | + | |
| 331 | + | |
341 | 332 | | |
342 | 333 | | |
343 | 334 | | |
| |||
0 commit comments