Commit bda29e4
authored
Limit number of function parameters in MergeSimilarFunctions (#7341)
MergeSimilarFunctions can merge functions whose bodies differ only the
constants they use. These different constants become parameters to the
merged function. In extreme cases, the optimization could produce an
arbitrary number of new parameters, exceeding implementation limits.
Cap the total number of parameters to a merged function at 255. The Web
limitation on the number of parameters is 1000, but other
implementations, including those on the JVM, cannot handle more than
255. It would be possible to make this limit configurable in the future.1 parent faaa985 commit bda29e4
3 files changed
Lines changed: 10131 additions & 0 deletions
File tree
- src
- passes
- test/lit/passes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
490 | 491 | | |
491 | 492 | | |
492 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
493 | 503 | | |
494 | 504 | | |
495 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
0 commit comments