One of my current projects is the reload-branch. This is an attempt to generally clean up the reload pass, primarily the inheritance code. This is something I started playing with years ago; I've recently put it on a branch in CVS.
Things that have been done on the branch:
- replace reload insn ordering using RELOAD_FOR_blah by dependencies automatically generated from the replacements. Reload insns are now placed by a mini-scheduler. Lifetimes of reload registers are computed from that schedule and used to determine conflicts.
- replace reload inheritance by a separate pass that is run on data collected by find_reloads
- try to make inheritance powerful enough that many other random optimizations scattered across reload can be deleted (I hope that, eventually, reload_cse_regs can go as well)
Known problems:
- There's a known design flaw in the inheritance code: Enabling optional reloads can change the schedule we computed for the reload insns. The simple way to work around this might be to test whether the reload register allocation is still valid despite this, and to bail out if not. That might lose some optimization opportunities though.
- It hasn't been properly tested on targets with autoinc addressing, and probably contains bugs and inefficiencies for autoinc.
- It needs tuning to make sure the generated code is at least as good as before.
- Memory management decisions are left over from pre-GC times, and must be revisited. Compile time is likely to increase as well.
Despite these problems, it seems to work well enough to bootstrap on a couple of platforms.
I'll continue to work on this as time allows, but it isn't currently one of the priorities at my job. Any help is welcome.