Commit 8de33da
committed
Handle up to 2^16 - 1 operands per inst, and error properly on more.
This PR addresses an underlying limitation that became a problem for
Cranelift recently, after folding return-value loads into call
pseudoinsts (thus producing single instructions with many operands): we
only supported 255 operands per instruction.
It appears that `Use` was using a `u8` for the "slot index" for an
operand as a result of earlier optimization/packing efforts. However,
the current shape of the struct leaves a padding byte free, so we should
be able to expand to a `u16` with no loss in performance.
Furthermore, previously we weren't catching the overflow, but rather
were silently wrapping around (eek). This properly returns a
`RegAllocError::TooManyOperands` now if an instruction has too many
operands (more than `u16::MAX`).1 parent b2bb25d commit 8de33da
4 files changed
+26
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
| 318 | + | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
362 | 367 | | |
363 | 368 | | |
364 | 369 | | |
365 | | - | |
| 370 | + | |
366 | 371 | | |
367 | 372 | | |
368 | 373 | | |
| |||
533 | 538 | | |
534 | 539 | | |
535 | 540 | | |
536 | | - | |
537 | | - | |
| 541 | + | |
| 542 | + | |
538 | 543 | | |
539 | 544 | | |
540 | 545 | | |
| |||
638 | 643 | | |
639 | 644 | | |
640 | 645 | | |
641 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
642 | 650 | | |
643 | 651 | | |
644 | 652 | | |
| |||
681 | 689 | | |
682 | 690 | | |
683 | 691 | | |
684 | | - | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
685 | 696 | | |
686 | 697 | | |
687 | 698 | | |
| |||
756 | 767 | | |
757 | 768 | | |
758 | 769 | | |
| 770 | + | |
| 771 | + | |
759 | 772 | | |
760 | 773 | | |
761 | 774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1577 | 1577 | | |
1578 | 1578 | | |
1579 | 1579 | | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
1580 | 1583 | | |
1581 | 1584 | | |
1582 | 1585 | | |
| |||
0 commit comments