Closed elliottt closed 5 months ago
Isn't the redundant move eliminator still useful when dealing with fixed-reg constraints? Since regalloc2 fundamentally can only model a vreg in a single location at a time, multiple fixed constaints can often introduce unnecessary back-and-forth copying which can be eliminated by the redundant move eliminator.
We do support overlapping liveranges now, so perhaps we could address this by allowing the value to exist in multiple places at once?
I benchmarked this PR today and found that it's a pretty significant regression for the execution time of most of our benchmarks. As such, I'm going to close the PR. There could still be a path forward to removing the RME, but it's beginning to feel less worthwhile :)
This PR removes the redundant move eliminator by changing where we store spill allocations: switching from allocating spills to bundles to instead spilling vregs for their full lifetime. Changes to the cranelift test suite are for the most part positive, though there are some cases where the number of stack slots grows as a result of the new spilling strategy. I think that this could probably be mitigated by revisiting how we compute spill weight, but would also like to see what the change to more substantial targets like spidermonkey are before committing to that.
The change consists of three parts:
I've fuzzed this for about 24 hours without discovering any new test failures, but I think it's a pretty substantial change that warrants more discussion once @cfallin is back.