https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90174
--- Comment #13 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- (In reply to Tamar Christina from comment #12) > (In reply to Vladimir Makarov from comment #11) > > I just expressed my point of view to the bottom-up approach. If somebody > > implements any new RA approach which at least does not hurt credible > > benchmarks (e.g. SPEC) and improve some benchmarks and does not complicate > > existing RA too much, nobody will have legitimate arguments not to include > > the new code into GCC. > > > > I think that may be for some cases bottom-up approach could work better. > > Probably this is code for number crunching (with a lot of loop iterations). > > For some cases top-down approach works better for loops with smaller number > > iterations (e.g. most loops in GCC itself). > > > > I don't know much about the current RA implementation, but would it be > possible you think to have this be heuristics driven? or do you think it > would be too expensive to try multiple strategies and keep the one that > works best? Probably trying multiple strategies will be too expensive. Also compile-time evaluation of allocation cost is not that accurate, especially taking into account that the local register allocator can change global RA decisions and the changes are unpredictable. If the top-down algorithm works better for some cases, we could get some experience when it works and try to find heuristics to choose the right algorithm. I think it would be more realistic approach. It sounds like a case for ML but I am sure ML will not work. It is not a smooth function, besides ML create a lot of problems with GCC building (benchmark set, costly building, valdiation and using ML model etc). So heuristics built on understanding is a way to go. But I speculated too much because there is no bottom-up RA implementation with finding its advantages (if there are any) and its disadvantages.