Repository navigation
Commit d895607
authored
[IRBuilder] Use multiple scratch locals for inputs (#9336)
Instead of using a single tuple-typed scratch local for multivalue
control flow inputs, allocate one scalar scratch local per input value.
This avoids eagerly packaging scalar inputs into a tuple on scope entry.
It also avoids allocating extra tuple scratch locals to extract elements
when inputs are consumed inside the scope.
Scalar input locals do have some downsides. Scopes that pass all of
their inputs through untouched must now repackage them with tuple.make.
Multivalue loop trampolines in fixLoopWithInput also still need a tuple
scratch local to unpack branch values into the scalar input locals.
However, real parameterized scopes usually consume their inputs as
individual values. Scalar input locals can also be coalesced directly by
standard local passes without tuple optimization, and they will allow
individual parameters to be tunneled across nested scopes with different
arities in a future commit.1 parent 707afbd commit d895607
7 files changed
Lines changed: 378 additions & 203 deletions
File tree
- src
- passes
- support
- wasm
- test/lit
- basic
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | | - | |
| 436 | + | |
| 437 | + | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | 464 | | |
472 | 465 | | |
473 | 466 | | |
| |||
514 | 507 | | |
515 | 508 | | |
516 | 509 | | |
517 | | - | |
| 510 | + | |
518 | 511 | | |
519 | 512 | | |
520 | 513 | | |
| |||
715 | 708 | | |
716 | 709 | | |
717 | 710 | | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
| 711 | + | |
747 | 712 | | |
748 | 713 | | |
749 | 714 | | |
| |||
806 | 771 | | |
807 | 772 | | |
808 | 773 | | |
809 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
810 | 777 | | |
811 | 778 | | |
812 | 779 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
781 | 792 | | |
782 | 793 | | |
783 | 794 | | |
| |||
877 | 888 | | |
878 | 889 | | |
879 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
880 | 927 | | |
881 | 928 | | |
882 | 929 | | |
| |||
1212 | 1259 | | |
1213 | 1260 | | |
1214 | 1261 | | |
1215 | | - | |
1216 | | - | |
| 1262 | + | |
| 1263 | + | |
1217 | 1264 | | |
1218 | 1265 | | |
1219 | 1266 | | |
| |||
1222 | 1269 | | |
1223 | 1270 | | |
1224 | 1271 | | |
1225 | | - | |
1226 | | - | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1227 | 1285 | | |
1228 | 1286 | | |
1229 | 1287 | | |
| |||
1368 | 1426 | | |
1369 | 1427 | | |
1370 | 1428 | | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
1374 | 1432 | | |
1375 | 1433 | | |
1376 | 1434 | | |
1377 | | - | |
| 1435 | + | |
| 1436 | + | |
1378 | 1437 | | |
1379 | 1438 | | |
1380 | 1439 | | |
1381 | | - | |
| 1440 | + | |
1382 | 1441 | | |
1383 | 1442 | | |
1384 | 1443 | | |
| |||
1388 | 1447 | | |
1389 | 1448 | | |
1390 | 1449 | | |
1391 | | - | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
1392 | 1453 | | |
1393 | 1454 | | |
1394 | 1455 | | |
| |||
1399 | 1460 | | |
1400 | 1461 | | |
1401 | 1462 | | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1406 | 1479 | | |
1407 | 1480 | | |
1408 | 1481 | | |
| |||
0 commit comments