sway
sway copied to clipboard
The inliner may be creating very huge functions
When working on a register spiller (#4722 / #4746) for https://github.com/FuelLabs/sway/issues/4631 and https://github.com/FuelLabs/sway/issues/4511, I observed that main
had ended up being very large (and hence causing high register pressure). This is likely a result of unnecessarily aggressive inlining. While we can now compile those with spilling, the compile times are too high (30m and 180m respectively on my laptop at the time of implementing the spiller).
Fix inliner heuristics against ending up with very large functions.
Depends on https://github.com/FuelLabs/sway/issues/2904 to be fixed first.